home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / diffutil.7 / diffutil
Tape Archive  |  1994-10-02  |  1.1 MB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: diffutil

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file POSIX tar archive (GNU) default
99% file POSIX tar archive (GNU), directory diffutils-2.7/, mode 40777 , uid 74720 , gid 1 , size 0 , seconds 5643445742, user eggert, group daemon default
98% file data default
62% TrID TAR - Tape ARchive (GNU) default
37% TrID TAR - Tape ARchive (directory) default
100% siegfried x-fmt/265 Tape Archive Format default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype GNU tar archive default
100% detectItEasy Archive: tar default
100% binwalkID POSIX tar archive (GNU), owner user name: "s-2.7/" default
100% xdgMime application/x-tar default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 64 69 66 66 75 74 69 6c | 73 2d 32 2e 37 2f 00 00 |diffutil|s-2.7/..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 37 37 20 00 20 37 34 37 |.... 407|77 . 747|
|00000070| 32 30 20 00 20 20 20 20 | 20 31 20 00 20 20 20 20 |20 . | 1 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 35 36 34 33 34 34 35 | 0 | 5643445|
|00000090| 37 34 32 20 20 31 32 32 | 35 35 00 20 35 00 00 00 |742 122|55. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 65 67 67 65 72 74 00 |.ustar |.eggert.|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 64 61 65 6d 6f 6e 00 |........|.daemon.|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 64 69 66 66 75 74 69 6c | 73 2d 32 2e 37 2f 64 69 |diffutil|s-2.7/di|
|00000210| 66 66 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |ff.c....|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 31 30 30 34 | 34 34 20 00 20 37 34 37 |....1004|44 . 747|
|00000270| 32 30 20 00 20 20 20 20 | 20 31 20 00 20 20 20 20 |20 . | 1 . |
|00000280| 20 20 37 33 33 34 33 20 | 20 35 36 34 30 33 33 32 | 73343 | 5640332|
|00000290| 34 30 34 20 20 31 33 34 | 33 35 00 20 30 00 00 00 |404 134|35. 0...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 65 67 67 65 72 74 00 |.ustar |.eggert.|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 64 61 65 6d 6f 6e 00 |........|.daemon.|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 2f 2a 20 47 4e 55 20 44 | 49 46 46 20 6d 61 69 6e |/* GNU D|IFF main|
|00000410| 20 72 6f 75 74 69 6e 65 | 2e 0a 20 20 20 43 6f 70 | routine|.. Cop|
|00000420| 79 72 69 67 68 74 20 28 | 43 29 20 31 39 38 38 2c |yright (|C) 1988,|
|00000430| 20 31 39 38 39 2c 20 31 | 39 39 32 2c 20 31 39 39 | 1989, 1|992, 199|
|00000440| 33 2c 20 31 39 39 34 20 | 46 72 65 65 20 53 6f 66 |3, 1994 |Free Sof|
|00000450| 74 77 61 72 65 20 46 6f | 75 6e 64 61 74 69 6f 6e |tware Fo|undation|
|00000460| 2c 20 49 6e 63 2e 0a 0a | 54 68 69 73 20 66 69 6c |, Inc...|This fil|
|00000470| 65 20 69 73 20 70 61 72 | 74 20 6f 66 20 47 4e 55 |e is par|t of GNU|
|00000480| 20 44 49 46 46 2e 0a 0a | 47 4e 55 20 44 49 46 46 | DIFF...|GNU DIFF|
|00000490| 20 69 73 20 66 72 65 65 | 20 73 6f 66 74 77 61 72 | is free| softwar|
|000004a0| 65 3b 20 79 6f 75 20 63 | 61 6e 20 72 65 64 69 73 |e; you c|an redis|
|000004b0| 74 72 69 62 75 74 65 20 | 69 74 20 61 6e 64 2f 6f |tribute |it and/o|
|000004c0| 72 20 6d 6f 64 69 66 79 | 0a 69 74 20 75 6e 64 65 |r modify|.it unde|
|000004d0| 72 20 74 68 65 20 74 65 | 72 6d 73 20 6f 66 20 74 |r the te|rms of t|
|000004e0| 68 65 20 47 4e 55 20 47 | 65 6e 65 72 61 6c 20 50 |he GNU G|eneral P|
|000004f0| 75 62 6c 69 63 20 4c 69 | 63 65 6e 73 65 20 61 73 |ublic Li|cense as|
|00000500| 20 70 75 62 6c 69 73 68 | 65 64 20 62 79 0a 74 68 | publish|ed by.th|
|00000510| 65 20 46 72 65 65 20 53 | 6f 66 74 77 61 72 65 20 |e Free S|oftware |
|00000520| 46 6f 75 6e 64 61 74 69 | 6f 6e 3b 20 65 69 74 68 |Foundati|on; eith|
|00000530| 65 72 20 76 65 72 73 69 | 6f 6e 20 32 2c 20 6f 72 |er versi|on 2, or|
|00000540| 20 28 61 74 20 79 6f 75 | 72 20 6f 70 74 69 6f 6e | (at you|r option|
|00000550| 29 0a 61 6e 79 20 6c 61 | 74 65 72 20 76 65 72 73 |).any la|ter vers|
|00000560| 69 6f 6e 2e 0a 0a 47 4e | 55 20 44 49 46 46 20 69 |ion...GN|U DIFF i|
|00000570| 73 20 64 69 73 74 72 69 | 62 75 74 65 64 20 69 6e |s distri|buted in|
|00000580| 20 74 68 65 20 68 6f 70 | 65 20 74 68 61 74 20 69 | the hop|e that i|
|00000590| 74 20 77 69 6c 6c 20 62 | 65 20 75 73 65 66 75 6c |t will b|e useful|
|000005a0| 2c 0a 62 75 74 20 57 49 | 54 48 4f 55 54 20 41 4e |,.but WI|THOUT AN|
|000005b0| 59 20 57 41 52 52 41 4e | 54 59 3b 20 77 69 74 68 |Y WARRAN|TY; with|
|000005c0| 6f 75 74 20 65 76 65 6e | 20 74 68 65 20 69 6d 70 |out even| the imp|
|000005d0| 6c 69 65 64 20 77 61 72 | 72 61 6e 74 79 20 6f 66 |lied war|ranty of|
|000005e0| 0a 4d 45 52 43 48 41 4e | 54 41 42 49 4c 49 54 59 |.MERCHAN|TABILITY|
|000005f0| 20 6f 72 20 46 49 54 4e | 45 53 53 20 46 4f 52 20 | or FITN|ESS FOR |
|00000600| 41 20 50 41 52 54 49 43 | 55 4c 41 52 20 50 55 52 |A PARTIC|ULAR PUR|
|00000610| 50 4f 53 45 2e 20 20 53 | 65 65 20 74 68 65 0a 47 |POSE. S|ee the.G|
|00000620| 4e 55 20 47 65 6e 65 72 | 61 6c 20 50 75 62 6c 69 |NU Gener|al Publi|
|00000630| 63 20 4c 69 63 65 6e 73 | 65 20 66 6f 72 20 6d 6f |c Licens|e for mo|
|00000640| 72 65 20 64 65 74 61 69 | 6c 73 2e 0a 0a 59 6f 75 |re detai|ls...You|
|00000650| 20 73 68 6f 75 6c 64 20 | 68 61 76 65 20 72 65 63 | should |have rec|
|00000660| 65 69 76 65 64 20 61 20 | 63 6f 70 79 20 6f 66 20 |eived a |copy of |
|00000670| 74 68 65 20 47 4e 55 20 | 47 65 6e 65 72 61 6c 20 |the GNU |General |
|00000680| 50 75 62 6c 69 63 20 4c | 69 63 65 6e 73 65 0a 61 |Public L|icense.a|
|00000690| 6c 6f 6e 67 20 77 69 74 | 68 20 47 4e 55 20 44 49 |long wit|h GNU DI|
|000006a0| 46 46 3b 20 73 65 65 20 | 74 68 65 20 66 69 6c 65 |FF; see |the file|
|000006b0| 20 43 4f 50 59 49 4e 47 | 2e 20 20 49 66 20 6e 6f | COPYING|. If no|
|000006c0| 74 2c 20 77 72 69 74 65 | 20 74 6f 0a 74 68 65 20 |t, write| to.the |
|000006d0| 46 72 65 65 20 53 6f 66 | 74 77 61 72 65 20 46 6f |Free Sof|tware Fo|
|000006e0| 75 6e 64 61 74 69 6f 6e | 2c 20 36 37 35 20 4d 61 |undation|, 675 Ma|
|000006f0| 73 73 20 41 76 65 2c 20 | 43 61 6d 62 72 69 64 67 |ss Ave, |Cambridg|
|00000700| 65 2c 20 4d 41 20 30 32 | 31 33 39 2c 20 55 53 41 |e, MA 02|139, USA|
|00000710| 2e 20 20 2a 2f 0a 0a 2f | 2a 20 47 4e 55 20 44 49 |. */../|* GNU DI|
|00000720| 46 46 20 77 61 73 20 77 | 72 69 74 74 65 6e 20 62 |FF was w|ritten b|
|00000730| 79 20 4d 69 6b 65 20 48 | 61 65 72 74 65 6c 2c 20 |y Mike H|aertel, |
|00000740| 44 61 76 69 64 20 48 61 | 79 65 73 2c 0a 20 20 20 |David Ha|yes,. |
|00000750| 52 69 63 68 61 72 64 20 | 53 74 61 6c 6c 6d 61 6e |Richard |Stallman|
|00000760| 2c 20 4c 65 6e 20 54 6f | 77 65 72 2c 20 61 6e 64 |, Len To|wer, and|
|00000770| 20 50 61 75 6c 20 45 67 | 67 65 72 74 2e 20 20 2a | Paul Eg|gert. *|
|00000780| 2f 0a 0a 23 64 65 66 69 | 6e 65 20 47 44 49 46 46 |/..#defi|ne GDIFF|
|00000790| 5f 4d 41 49 4e 0a 23 69 | 6e 63 6c 75 64 65 20 22 |_MAIN.#i|nclude "|
|000007a0| 64 69 66 66 2e 68 22 0a | 23 69 6e 63 6c 75 64 65 |diff.h".|#include|
|000007b0| 20 3c 73 69 67 6e 61 6c | 2e 68 3e 0a 23 69 6e 63 | <signal|.h>.#inc|
|000007c0| 6c 75 64 65 20 22 67 65 | 74 6f 70 74 2e 68 22 0a |lude "ge|topt.h".|
|000007d0| 23 69 6e 63 6c 75 64 65 | 20 22 66 6e 6d 61 74 63 |#include| "fnmatc|
|000007e0| 68 2e 68 22 0a 0a 23 69 | 66 6e 64 65 66 20 44 45 |h.h"..#i|fndef DE|
|000007f0| 46 41 55 4c 54 5f 57 49 | 44 54 48 0a 23 64 65 66 |FAULT_WI|DTH.#def|
|00000800| 69 6e 65 20 44 45 46 41 | 55 4c 54 5f 57 49 44 54 |ine DEFA|ULT_WIDT|
|00000810| 48 20 31 33 30 0a 23 65 | 6e 64 69 66 0a 0a 23 69 |H 130.#e|ndif..#i|
|00000820| 66 6e 64 65 66 20 47 55 | 54 54 45 52 5f 57 49 44 |fndef GU|TTER_WID|
|00000830| 54 48 5f 4d 49 4e 49 4d | 55 4d 0a 23 64 65 66 69 |TH_MINIM|UM.#defi|
|00000840| 6e 65 20 47 55 54 54 45 | 52 5f 57 49 44 54 48 5f |ne GUTTE|R_WIDTH_|
|00000850| 4d 49 4e 49 4d 55 4d 20 | 33 0a 23 65 6e 64 69 66 |MINIMUM |3.#endif|
|00000860| 0a 0a 73 74 61 74 69 63 | 20 63 68 61 72 20 63 6f |..static| char co|
|00000870| 6e 73 74 20 2a 66 69 6c | 65 74 79 70 65 20 50 41 |nst *fil|etype PA|
|00000880| 52 41 4d 53 28 28 73 74 | 72 75 63 74 20 73 74 61 |RAMS((st|ruct sta|
|00000890| 74 20 63 6f 6e 73 74 20 | 2a 29 29 3b 0a 73 74 61 |t const |*));.sta|
|000008a0| 74 69 63 20 63 68 61 72 | 20 2a 6f 70 74 69 6f 6e |tic char| *option|
|000008b0| 5f 6c 69 73 74 20 50 41 | 52 41 4d 53 28 28 63 68 |_list PA|RAMS((ch|
|000008c0| 61 72 20 2a 2a 2c 20 69 | 6e 74 29 29 3b 0a 73 74 |ar **, i|nt));.st|
|000008d0| 61 74 69 63 20 69 6e 74 | 20 61 64 64 5f 65 78 63 |atic int| add_exc|
|000008e0| 6c 75 64 65 5f 66 69 6c | 65 20 50 41 52 41 4d 53 |lude_fil|e PARAMS|
|000008f0| 28 28 63 68 61 72 20 63 | 6f 6e 73 74 20 2a 29 29 |((char c|onst *))|
|00000900| 3b 0a 73 74 61 74 69 63 | 20 69 6e 74 20 63 6b 5f |;.static| int ck_|
|00000910| 61 74 6f 69 20 50 41 52 | 41 4d 53 28 28 63 68 61 |atoi PAR|AMS((cha|
|00000920| 72 20 63 6f 6e 73 74 20 | 2a 2c 20 69 6e 74 20 2a |r const |*, int *|
|00000930| 29 29 3b 0a 73 74 61 74 | 69 63 20 69 6e 74 20 63 |));.stat|ic int c|
|00000940| 6f 6d 70 61 72 65 5f 66 | 69 6c 65 73 20 50 41 52 |ompare_f|iles PAR|
|00000950| 41 4d 53 28 28 63 68 61 | 72 20 63 6f 6e 73 74 20 |AMS((cha|r const |
|00000960| 2a 2c 20 63 68 61 72 20 | 63 6f 6e 73 74 20 2a 2c |*, char |const *,|
|00000970| 20 63 68 61 72 20 63 6f | 6e 73 74 20 2a 2c 20 63 | char co|nst *, c|
|00000980| 68 61 72 20 63 6f 6e 73 | 74 20 2a 2c 20 69 6e 74 |har cons|t *, int|
|00000990| 29 29 3b 0a 73 74 61 74 | 69 63 20 69 6e 74 20 73 |));.stat|ic int s|
|000009a0| 70 65 63 69 66 79 5f 66 | 6f 72 6d 61 74 20 50 41 |pecify_f|ormat PA|
|000009b0| 52 41 4d 53 28 28 63 68 | 61 72 20 2a 2a 2c 20 63 |RAMS((ch|ar **, c|
|000009c0| 68 61 72 20 2a 29 29 3b | 0a 73 74 61 74 69 63 20 |har *));|.static |
|000009d0| 76 6f 69 64 20 61 64 64 | 5f 65 78 63 6c 75 64 65 |void add|_exclude|
|000009e0| 20 50 41 52 41 4d 53 28 | 28 63 68 61 72 20 63 6f | PARAMS(|(char co|
|000009f0| 6e 73 74 20 2a 29 29 3b | 0a 73 74 61 74 69 63 20 |nst *));|.static |
|00000a00| 76 6f 69 64 20 61 64 64 | 5f 72 65 67 65 78 70 20 |void add|_regexp |
|00000a10| 50 41 52 41 4d 53 28 28 | 73 74 72 75 63 74 20 72 |PARAMS((|struct r|
|00000a20| 65 67 65 78 70 5f 6c 69 | 73 74 20 2a 2a 2c 20 63 |egexp_li|st **, c|
|00000a30| 68 61 72 20 63 6f 6e 73 | 74 20 2a 29 29 3b 0a 73 |har cons|t *));.s|
|00000a40| 74 61 74 69 63 20 76 6f | 69 64 20 73 70 65 63 69 |tatic vo|id speci|
|00000a50| 66 79 5f 73 74 79 6c 65 | 20 50 41 52 41 4d 53 28 |fy_style| PARAMS(|
|00000a60| 28 65 6e 75 6d 20 6f 75 | 74 70 75 74 5f 73 74 79 |(enum ou|tput_sty|
|00000a70| 6c 65 29 29 3b 0a 73 74 | 61 74 69 63 20 76 6f 69 |le));.st|atic voi|
|00000a80| 64 20 74 72 79 5f 68 65 | 6c 70 20 50 41 52 41 4d |d try_he|lp PARAM|
|00000a90| 53 28 28 63 68 61 72 20 | 63 6f 6e 73 74 20 2a 29 |S((char |const *)|
|00000aa0| 29 3b 0a 73 74 61 74 69 | 63 20 76 6f 69 64 20 63 |);.stati|c void c|
|00000ab0| 68 65 63 6b 5f 73 74 64 | 6f 75 74 20 50 41 52 41 |heck_std|out PARA|
|00000ac0| 4d 53 28 28 76 6f 69 64 | 29 29 3b 0a 73 74 61 74 |MS((void|));.stat|
|00000ad0| 69 63 20 76 6f 69 64 20 | 75 73 61 67 65 20 50 41 |ic void |usage PA|
|00000ae0| 52 41 4d 53 28 28 76 6f | 69 64 29 29 3b 0a 0a 2f |RAMS((vo|id));../|
|00000af0| 2a 20 4e 6f 6e 7a 65 72 | 6f 20 66 6f 72 20 2d 72 |* Nonzer|o for -r|
|00000b00| 3a 20 69 66 20 63 6f 6d | 70 61 72 69 6e 67 20 74 |: if com|paring t|
|00000b10| 77 6f 20 64 69 72 65 63 | 74 6f 72 69 65 73 2c 0a |wo direc|tories,.|
|00000b20| 20 20 20 63 6f 6d 70 61 | 72 65 20 74 68 65 69 72 | compa|re their|
|00000b30| 20 63 6f 6d 6d 6f 6e 20 | 73 75 62 64 69 72 65 63 | common |subdirec|
|00000b40| 74 6f 72 69 65 73 20 72 | 65 63 75 72 73 69 76 65 |tories r|ecursive|
|00000b50| 6c 79 2e 20 20 2a 2f 0a | 0a 73 74 61 74 69 63 20 |ly. */.|.static |
|00000b60| 69 6e 74 20 72 65 63 75 | 72 73 69 76 65 3b 0a 0a |int recu|rsive;..|
|00000b70| 2f 2a 20 46 6f 72 20 64 | 65 62 75 67 67 69 6e 67 |/* For d|ebugging|
|00000b80| 3a 20 64 6f 6e 27 74 20 | 64 6f 20 64 69 73 63 61 |: don't |do disca|
|00000b90| 72 64 5f 63 6f 6e 66 75 | 73 69 6e 67 5f 6c 69 6e |rd_confu|sing_lin|
|00000ba0| 65 73 2e 20 20 2a 2f 0a | 0a 69 6e 74 20 6e 6f 5f |es. */.|.int no_|
|00000bb0| 64 69 73 63 61 72 64 73 | 3b 0a 0a 23 69 66 20 48 |discards|;..#if H|
|00000bc0| 41 56 45 5f 53 45 54 4d | 4f 44 45 0a 2f 2a 20 49 |AVE_SETM|ODE./* I|
|00000bd0| 2f 4f 20 6d 6f 64 65 3a | 20 6e 6f 6e 7a 65 72 6f |/O mode:| nonzero|
|00000be0| 20 6f 6e 6c 79 20 69 66 | 20 75 73 69 6e 67 20 62 | only if| using b|
|00000bf0| 69 6e 61 72 79 20 69 6e | 70 75 74 2f 6f 75 74 70 |inary in|put/outp|
|00000c00| 75 74 2e 20 20 2a 2f 0a | 73 74 61 74 69 63 20 69 |ut. */.|static i|
|00000c10| 6e 74 20 62 69 6e 61 72 | 79 5f 49 5f 4f 3b 0a 23 |nt binar|y_I_O;.#|
|00000c20| 65 6e 64 69 66 0a 0a 2f | 2a 20 52 65 74 75 72 6e |endif../|* Return|
|00000c30| 20 61 20 73 74 72 69 6e | 67 20 63 6f 6e 74 61 69 | a strin|g contai|
|00000c40| 6e 69 6e 67 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |ning the| command|
|00000c50| 20 6f 70 74 69 6f 6e 73 | 20 77 69 74 68 20 77 68 | options| with wh|
|00000c60| 69 63 68 20 64 69 66 66 | 20 77 61 73 20 69 6e 76 |ich diff| was inv|
|00000c70| 6f 6b 65 64 2e 0a 20 20 | 20 53 70 61 63 65 73 20 |oked.. | Spaces |
|00000c80| 61 70 70 65 61 72 20 62 | 65 74 77 65 65 6e 20 77 |appear b|etween w|
|00000c90| 68 61 74 20 77 65 72 65 | 20 73 65 70 61 72 61 74 |hat were| separat|
|00000ca0| 65 20 41 52 47 56 2d 65 | 6c 65 6d 65 6e 74 73 2e |e ARGV-e|lements.|
|00000cb0| 0a 20 20 20 54 68 65 72 | 65 20 69 73 20 61 20 73 |. Ther|e is a s|
|00000cc0| 70 61 63 65 20 61 74 20 | 74 68 65 20 62 65 67 69 |pace at |the begi|
|00000cd0| 6e 6e 69 6e 67 20 62 75 | 74 20 6e 6f 6e 65 20 61 |nning bu|t none a|
|00000ce0| 74 20 74 68 65 20 65 6e | 64 2e 0a 20 20 20 49 66 |t the en|d.. If|
|00000cf0| 20 74 68 65 72 65 20 77 | 65 72 65 20 6e 6f 20 6f | there w|ere no o|
|00000d00| 70 74 69 6f 6e 73 2c 20 | 74 68 65 20 72 65 73 75 |ptions, |the resu|
|00000d10| 6c 74 20 69 73 20 61 6e | 20 65 6d 70 74 79 20 73 |lt is an| empty s|
|00000d20| 74 72 69 6e 67 2e 0a 0a | 20 20 20 41 72 67 75 6d |tring...| Argum|
|00000d30| 65 6e 74 73 3a 20 4f 50 | 54 49 4f 4e 56 45 43 2c |ents: OP|TIONVEC,|
|00000d40| 20 61 20 76 65 63 74 6f | 72 20 63 6f 6e 74 61 69 | a vecto|r contai|
|00000d50| 6e 69 6e 67 20 73 65 70 | 61 72 61 74 65 20 41 52 |ning sep|arate AR|
|00000d60| 47 56 2d 65 6c 65 6d 65 | 6e 74 73 2c 20 61 6e 64 |GV-eleme|nts, and|
|00000d70| 20 43 4f 55 4e 54 2c 0a | 20 20 20 74 68 65 20 6c | COUNT,.| the l|
|00000d80| 65 6e 67 74 68 20 6f 66 | 20 74 68 61 74 20 76 65 |ength of| that ve|
|00000d90| 63 74 6f 72 2e 20 20 2a | 2f 0a 0a 73 74 61 74 69 |ctor. *|/..stati|
|00000da0| 63 20 63 68 61 72 20 2a | 0a 6f 70 74 69 6f 6e 5f |c char *|.option_|
|00000db0| 6c 69 73 74 20 28 6f 70 | 74 69 6f 6e 76 65 63 2c |list (op|tionvec,|
|00000dc0| 20 63 6f 75 6e 74 29 0a | 20 20 20 20 20 63 68 61 | count).| cha|
|00000dd0| 72 20 2a 2a 6f 70 74 69 | 6f 6e 76 65 63 3b 20 20 |r **opti|onvec; |
|00000de0| 2f 2a 20 57 61 73 20 60 | 76 65 63 74 6f 72 27 2c |/* Was `|vector',|
|00000df0| 20 62 75 74 20 74 68 61 | 74 20 63 6f 6c 6c 69 64 | but tha|t collid|
|00000e00| 65 73 20 6f 6e 20 41 6c | 6c 69 61 6e 74 2e 20 20 |es on Al|liant. |
|00000e10| 2a 2f 0a 20 20 20 20 20 | 69 6e 74 20 63 6f 75 6e |*/. |int coun|
|00000e20| 74 3b 0a 7b 0a 20 20 69 | 6e 74 20 69 3b 0a 20 20 |t;.{. i|nt i;. |
|00000e30| 73 69 7a 65 5f 74 20 6c | 65 6e 67 74 68 20 3d 20 |size_t l|ength = |
|00000e40| 30 3b 0a 20 20 63 68 61 | 72 20 2a 72 65 73 75 6c |0;. cha|r *resul|
|00000e50| 74 3b 0a 0a 20 20 66 6f | 72 20 28 69 20 3d 20 30 |t;.. fo|r (i = 0|
|00000e60| 3b 20 69 20 3c 20 63 6f | 75 6e 74 3b 20 69 2b 2b |; i < co|unt; i++|
|00000e70| 29 0a 20 20 20 20 6c 65 | 6e 67 74 68 20 2b 3d 20 |). le|ngth += |
|00000e80| 73 74 72 6c 65 6e 20 28 | 6f 70 74 69 6f 6e 76 65 |strlen (|optionve|
|00000e90| 63 5b 69 5d 29 20 2b 20 | 31 3b 0a 0a 20 20 72 65 |c[i]) + |1;.. re|
|00000ea0| 73 75 6c 74 20 3d 20 78 | 6d 61 6c 6c 6f 63 20 28 |sult = x|malloc (|
|00000eb0| 6c 65 6e 67 74 68 20 2b | 20 31 29 3b 0a 20 20 72 |length +| 1);. r|
|00000ec0| 65 73 75 6c 74 5b 30 5d | 20 3d 20 30 3b 0a 0a 20 |esult[0]| = 0;.. |
|00000ed0| 20 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 69 20 3c | for (i |= 0; i <|
|00000ee0| 20 63 6f 75 6e 74 3b 20 | 69 2b 2b 29 0a 20 20 20 | count; |i++). |
|00000ef0| 20 7b 0a 20 20 20 20 20 | 20 73 74 72 63 61 74 20 | {. | strcat |
|00000f00| 28 72 65 73 75 6c 74 2c | 20 22 20 22 29 3b 0a 20 |(result,| " ");. |
|00000f10| 20 20 20 20 20 73 74 72 | 63 61 74 20 28 72 65 73 | str|cat (res|
|00000f20| 75 6c 74 2c 20 6f 70 74 | 69 6f 6e 76 65 63 5b 69 |ult, opt|ionvec[i|
|00000f30| 5d 29 3b 0a 20 20 20 20 | 7d 0a 0a 20 20 72 65 74 |]);. |}.. ret|
|00000f40| 75 72 6e 20 72 65 73 75 | 6c 74 3b 0a 7d 0a 0c 0a |urn resu|lt;.}...|
|00000f50| 2f 2a 20 43 6f 6e 76 65 | 72 74 20 53 54 52 20 74 |/* Conve|rt STR t|
|00000f60| 6f 20 61 20 70 6f 73 69 | 74 69 76 65 20 69 6e 74 |o a posi|tive int|
|00000f70| 65 67 65 72 2c 20 73 74 | 6f 72 69 6e 67 20 74 68 |eger, st|oring th|
|00000f80| 65 20 72 65 73 75 6c 74 | 20 69 6e 20 2a 4f 55 54 |e result| in *OUT|
|00000f90| 2e 0a 20 20 20 49 66 20 | 53 54 52 20 69 73 20 6e |.. If |STR is n|
|00000fa0| 6f 74 20 61 20 76 61 6c | 69 64 20 69 6e 74 65 67 |ot a val|id integ|
|00000fb0| 65 72 2c 20 72 65 74 75 | 72 6e 20 2d 31 20 28 6f |er, retu|rn -1 (o|
|00000fc0| 74 68 65 72 77 69 73 65 | 20 30 29 2e 20 2a 2f 0a |therwise| 0). */.|
|00000fd0| 73 74 61 74 69 63 20 69 | 6e 74 0a 63 6b 5f 61 74 |static i|nt.ck_at|
|00000fe0| 6f 69 20 28 73 74 72 2c | 20 6f 75 74 29 0a 20 20 |oi (str,| out). |
|00000ff0| 20 20 20 63 68 61 72 20 | 63 6f 6e 73 74 20 2a 73 | char |const *s|
|00001000| 74 72 3b 0a 20 20 20 20 | 20 69 6e 74 20 2a 6f 75 |tr;. | int *ou|
|00001010| 74 3b 0a 7b 0a 20 20 63 | 68 61 72 20 63 6f 6e 73 |t;.{. c|har cons|
|00001020| 74 20 2a 70 3b 0a 20 20 | 66 6f 72 20 28 70 20 3d |t *p;. |for (p =|
|00001030| 20 73 74 72 3b 20 2a 70 | 3b 20 70 2b 2b 29 0a 20 | str; *p|; p++). |
|00001040| 20 20 20 69 66 20 28 2a | 70 20 3c 20 27 30 27 20 | if (*|p < '0' |
|00001050| 7c 7c 20 2a 70 20 3e 20 | 27 39 27 29 0a 20 20 20 ||| *p > |'9'). |
|00001060| 20 20 20 72 65 74 75 72 | 6e 20 2d 31 3b 0a 0a 20 | retur|n -1;.. |
|00001070| 20 2a 6f 75 74 20 3d 20 | 61 74 6f 69 20 28 6f 70 | *out = |atoi (op|
|00001080| 74 61 72 67 29 3b 0a 20 | 20 72 65 74 75 72 6e 20 |targ);. | return |
|00001090| 30 3b 0a 7d 0a 0c 0a 2f | 2a 20 4b 65 65 70 20 74 |0;.}.../|* Keep t|
|000010a0| 72 61 63 6b 20 6f 66 20 | 65 78 63 6c 75 64 65 64 |rack of |excluded|
|000010b0| 20 66 69 6c 65 20 6e 61 | 6d 65 20 70 61 74 74 65 | file na|me patte|
|000010c0| 72 6e 73 2e 20 20 2a 2f | 0a 0a 73 74 61 74 69 63 |rns. */|..static|
|000010d0| 20 63 68 61 72 20 63 6f | 6e 73 74 20 2a 2a 65 78 | char co|nst **ex|
|000010e0| 63 6c 75 64 65 3b 0a 73 | 74 61 74 69 63 20 69 6e |clude;.s|tatic in|
|000010f0| 74 20 65 78 63 6c 75 64 | 65 5f 61 6c 6c 6f 63 2c |t exclud|e_alloc,|
|00001100| 20 65 78 63 6c 75 64 65 | 5f 63 6f 75 6e 74 3b 0a | exclude|_count;.|
|00001110| 0a 69 6e 74 0a 65 78 63 | 6c 75 64 65 64 5f 66 69 |.int.exc|luded_fi|
|00001120| 6c 65 6e 61 6d 65 20 28 | 66 29 0a 20 20 20 20 20 |lename (|f). |
|00001130| 63 68 61 72 20 63 6f 6e | 73 74 20 2a 66 3b 0a 7b |char con|st *f;.{|
|00001140| 0a 20 20 69 6e 74 20 69 | 3b 0a 20 20 66 6f 72 20 |. int i|;. for |
|00001150| 28 69 20 3d 20 30 3b 20 | 20 69 20 3c 20 65 78 63 |(i = 0; | i < exc|
|00001160| 6c 75 64 65 5f 63 6f 75 | 6e 74 3b 20 20 69 2b 2b |lude_cou|nt; i++|
|00001170| 29 0a 20 20 20 20 69 66 | 20 28 66 6e 6d 61 74 63 |). if| (fnmatc|
|00001180| 68 20 28 65 78 63 6c 75 | 64 65 5b 69 5d 2c 20 66 |h (exclu|de[i], f|
|00001190| 2c 20 30 29 20 3d 3d 20 | 30 29 0a 20 20 20 20 20 |, 0) == |0). |
|000011a0| 20 72 65 74 75 72 6e 20 | 31 3b 0a 20 20 72 65 74 | return |1;. ret|
|000011b0| 75 72 6e 20 30 3b 0a 7d | 0a 0a 73 74 61 74 69 63 |urn 0;.}|..static|
|000011c0| 20 76 6f 69 64 0a 61 64 | 64 5f 65 78 63 6c 75 64 | void.ad|d_exclud|
|000011d0| 65 20 28 70 61 74 74 65 | 72 6e 29 0a 20 20 20 20 |e (patte|rn). |
|000011e0| 20 63 68 61 72 20 63 6f | 6e 73 74 20 2a 70 61 74 | char co|nst *pat|
|000011f0| 74 65 72 6e 3b 0a 7b 0a | 20 20 69 66 20 28 65 78 |tern;.{.| if (ex|
|00001200| 63 6c 75 64 65 5f 61 6c | 6c 6f 63 20 3c 3d 20 65 |clude_al|loc <= e|
|00001210| 78 63 6c 75 64 65 5f 63 | 6f 75 6e 74 29 0a 20 20 |xclude_c|ount). |
|00001220| 20 20 65 78 63 6c 75 64 | 65 20 3d 20 28 63 68 61 | exclud|e = (cha|
|00001230| 72 20 63 6f 6e 73 74 20 | 2a 2a 29 0a 09 20 20 20 |r const |**).. |
|00001240| 20 20 20 28 65 78 63 6c | 75 64 65 5f 61 6c 6c 6f | (excl|ude_allo|
|00001250| 63 20 3d 3d 20 30 0a 09 | 20 20 20 20 20 20 20 3f |c == 0..| ?|
|00001260| 20 78 6d 61 6c 6c 6f 63 | 20 28 28 65 78 63 6c 75 | xmalloc| ((exclu|
|00001270| 64 65 5f 61 6c 6c 6f 63 | 20 3d 20 36 34 29 20 2a |de_alloc| = 64) *|
|00001280| 20 73 69 7a 65 6f 66 20 | 28 2a 65 78 63 6c 75 64 | sizeof |(*exclud|
|00001290| 65 29 29 0a 09 20 20 20 | 20 20 20 20 3a 20 78 72 |e)).. | : xr|
|000012a0| 65 61 6c 6c 6f 63 20 28 | 65 78 63 6c 75 64 65 2c |ealloc (|exclude,|
|000012b0| 20 28 65 78 63 6c 75 64 | 65 5f 61 6c 6c 6f 63 20 | (exclud|e_alloc |
|000012c0| 2a 3d 20 32 29 20 2a 20 | 73 69 7a 65 6f 66 20 28 |*= 2) * |sizeof (|
|000012d0| 2a 65 78 63 6c 75 64 65 | 29 29 29 3b 0a 0a 20 20 |*exclude|)));.. |
|000012e0| 65 78 63 6c 75 64 65 5b | 65 78 63 6c 75 64 65 5f |exclude[|exclude_|
|000012f0| 63 6f 75 6e 74 2b 2b 5d | 20 3d 20 70 61 74 74 65 |count++]| = patte|
|00001300| 72 6e 3b 0a 7d 0a 0a 73 | 74 61 74 69 63 20 69 6e |rn;.}..s|tatic in|
|00001310| 74 0a 61 64 64 5f 65 78 | 63 6c 75 64 65 5f 66 69 |t.add_ex|clude_fi|
|00001320| 6c 65 20 28 6e 61 6d 65 | 29 0a 20 20 20 20 20 63 |le (name|). c|
|00001330| 68 61 72 20 63 6f 6e 73 | 74 20 2a 6e 61 6d 65 3b |har cons|t *name;|
|00001340| 0a 7b 0a 20 20 73 74 72 | 75 63 74 20 66 69 6c 65 |.{. str|uct file|
|00001350| 5f 64 61 74 61 20 66 3b | 0a 20 20 63 68 61 72 20 |_data f;|. char |
|00001360| 2a 70 2c 20 2a 71 2c 20 | 2a 6c 69 6d 3b 0a 0a 20 |*p, *q, |*lim;.. |
|00001370| 20 66 2e 6e 61 6d 65 20 | 3d 20 6f 70 74 61 72 67 | f.name |= optarg|
|00001380| 3b 0a 20 20 66 2e 64 65 | 73 63 20 3d 20 28 73 74 |;. f.de|sc = (st|
|00001390| 72 63 6d 70 20 28 6f 70 | 74 61 72 67 2c 20 22 2d |rcmp (op|targ, "-|
|000013a0| 22 29 20 3d 3d 20 30 0a | 09 20 20 20 20 3f 20 53 |") == 0.|. ? S|
|000013b0| 54 44 49 4e 5f 46 49 4c | 45 4e 4f 0a 09 20 20 20 |TDIN_FIL|ENO.. |
|000013c0| 20 3a 20 6f 70 65 6e 20 | 28 6f 70 74 61 72 67 2c | : open |(optarg,|
|000013d0| 20 4f 5f 52 44 4f 4e 4c | 59 2c 20 30 29 29 3b 0a | O_RDONL|Y, 0));.|
|000013e0| 20 20 69 66 20 28 66 2e | 64 65 73 63 20 3c 20 30 | if (f.|desc < 0|
|000013f0| 20 7c 7c 20 66 73 74 61 | 74 20 28 66 2e 64 65 73 | || fsta|t (f.des|
|00001400| 63 2c 20 26 66 2e 73 74 | 61 74 29 20 21 3d 20 30 |c, &f.st|at) != 0|
|00001410| 29 0a 20 20 20 20 72 65 | 74 75 72 6e 20 2d 31 3b |). re|turn -1;|
|00001420| 0a 0a 20 20 73 69 70 20 | 28 26 66 2c 20 31 29 3b |.. sip |(&f, 1);|
|00001430| 0a 20 20 73 6c 75 72 70 | 20 28 26 66 29 3b 0a 0a |. slurp| (&f);..|
|00001440| 20 20 66 6f 72 20 28 70 | 20 3d 20 66 2e 62 75 66 | for (p| = f.buf|
|00001450| 66 65 72 2c 20 6c 69 6d | 20 3d 20 70 20 2b 20 66 |fer, lim| = p + f|
|00001460| 2e 62 75 66 66 65 72 65 | 64 5f 63 68 61 72 73 3b |.buffere|d_chars;|
|00001470| 20 20 70 20 3c 20 6c 69 | 6d 3b 20 20 70 20 3d 20 | p < li|m; p = |
|00001480| 71 29 0a 20 20 20 20 7b | 0a 20 20 20 20 20 20 71 |q). {|. q|
|00001490| 20 3d 20 28 63 68 61 72 | 20 2a 29 20 6d 65 6d 63 | = (char| *) memc|
|000014a0| 68 72 20 28 70 2c 20 27 | 5c 6e 27 2c 20 6c 69 6d |hr (p, '|\n', lim|
|000014b0| 20 2d 20 70 29 3b 0a 20 | 20 20 20 20 20 69 66 20 | - p);. | if |
|000014c0| 28 21 71 29 0a 09 71 20 | 3d 20 6c 69 6d 3b 0a 20 |(!q)..q |= lim;. |
|000014d0| 20 20 20 20 20 2a 71 2b | 2b 20 3d 20 30 3b 0a 20 | *q+|+ = 0;. |
|000014e0| 20 20 20 20 20 61 64 64 | 5f 65 78 63 6c 75 64 65 | add|_exclude|
|000014f0| 20 28 70 29 3b 0a 20 20 | 20 20 7d 0a 0a 20 20 72 | (p);. | }.. r|
|00001500| 65 74 75 72 6e 20 63 6c | 6f 73 65 20 28 66 2e 64 |eturn cl|ose (f.d|
|00001510| 65 73 63 29 3b 0a 7d 0a | 0c 0a 2f 2a 20 54 68 65 |esc);.}.|../* The|
|00001520| 20 6e 75 6d 62 65 72 73 | 20 31 32 39 2d 20 74 68 | numbers| 129- th|
|00001530| 61 74 20 61 70 70 65 61 | 72 20 69 6e 20 74 68 65 |at appea|r in the|
|00001540| 20 66 6f 75 72 74 68 20 | 65 6c 65 6d 65 6e 74 20 | fourth |element |
|00001550| 6f 66 20 73 6f 6d 65 20 | 65 6e 74 72 69 65 73 0a |of some |entries.|
|00001560| 20 20 20 74 65 6c 6c 20 | 74 68 65 20 62 69 67 20 | tell |the big |
|00001570| 73 77 69 74 63 68 20 69 | 6e 20 60 6d 61 69 6e 27 |switch i|n `main'|
|00001580| 20 68 6f 77 20 74 6f 20 | 70 72 6f 63 65 73 73 20 | how to |process |
|00001590| 74 68 6f 73 65 20 6f 70 | 74 69 6f 6e 73 2e 20 20 |those op|tions. |
|000015a0| 2a 2f 0a 0a 73 74 61 74 | 69 63 20 73 74 72 75 63 |*/..stat|ic struc|
|000015b0| 74 20 6f 70 74 69 6f 6e | 20 63 6f 6e 73 74 20 6c |t option| const l|
|000015c0| 6f 6e 67 6f 70 74 73 5b | 5d 20 3d 0a 7b 0a 20 20 |ongopts[|] =.{. |
|000015d0| 7b 22 69 67 6e 6f 72 65 | 2d 62 6c 61 6e 6b 2d 6c |{"ignore|-blank-l|
|000015e0| 69 6e 65 73 22 2c 20 30 | 2c 20 30 2c 20 27 42 27 |ines", 0|, 0, 'B'|
|000015f0| 7d 2c 0a 20 20 7b 22 63 | 6f 6e 74 65 78 74 22 2c |},. {"c|ontext",|
|00001600| 20 32 2c 20 30 2c 20 27 | 43 27 7d 2c 0a 20 20 7b | 2, 0, '|C'},. {|
|00001610| 22 69 66 64 65 66 22 2c | 20 31 2c 20 30 2c 20 27 |"ifdef",| 1, 0, '|
|00001620| 44 27 7d 2c 0a 20 20 7b | 22 73 68 6f 77 2d 66 75 |D'},. {|"show-fu|
|00001630| 6e 63 74 69 6f 6e 2d 6c | 69 6e 65 22 2c 20 31 2c |nction-l|ine", 1,|
|00001640| 20 30 2c 20 27 46 27 7d | 2c 0a 20 20 7b 22 73 70 | 0, 'F'}|,. {"sp|
|00001650| 65 65 64 2d 6c 61 72 67 | 65 2d 66 69 6c 65 73 22 |eed-larg|e-files"|
|00001660| 2c 20 30 2c 20 30 2c 20 | 27 48 27 7d 2c 0a 20 20 |, 0, 0, |'H'},. |
|00001670| 7b 22 69 67 6e 6f 72 65 | 2d 6d 61 74 63 68 69 6e |{"ignore|-matchin|
|00001680| 67 2d 6c 69 6e 65 73 22 | 2c 20 31 2c 20 30 2c 20 |g-lines"|, 1, 0, |
|00001690| 27 49 27 7d 2c 0a 20 20 | 7b 22 6c 61 62 65 6c 22 |'I'},. |{"label"|
|000016a0| 2c 20 31 2c 20 30 2c 20 | 27 4c 27 7d 2c 0a 20 20 |, 1, 0, |'L'},. |
|000016b0| 7b 22 66 69 6c 65 2d 6c | 61 62 65 6c 22 2c 20 31 |{"file-l|abel", 1|
|000016c0| 2c 20 30 2c 20 27 4c 27 | 7d 2c 09 2f 2a 20 41 6e |, 0, 'L'|},./* An|
|000016d0| 20 61 6c 69 61 73 2c 20 | 6e 6f 20 6c 6f 6e 67 65 | alias, |no longe|
|000016e0| 72 20 72 65 63 6f 6d 6d | 65 6e 64 65 64 20 2a 2f |r recomm|ended */|
|000016f0| 0a 20 20 7b 22 6e 65 77 | 2d 66 69 6c 65 22 2c 20 |. {"new|-file", |
|00001700| 30 2c 20 30 2c 20 27 4e | 27 7d 2c 0a 20 20 7b 22 |0, 0, 'N|'},. {"|
|00001710| 65 6e 74 69 72 65 2d 6e | 65 77 2d 66 69 6c 65 22 |entire-n|ew-file"|
|00001720| 2c 20 30 2c 20 30 2c 20 | 27 4e 27 7d 2c 09 2f 2a |, 0, 0, |'N'},./*|
|00001730| 20 41 6e 20 61 6c 69 61 | 73 2c 20 6e 6f 20 6c 6f | An alia|s, no lo|
|00001740| 6e 67 65 72 20 72 65 63 | 6f 6d 6d 65 6e 64 65 64 |nger rec|ommended|
|00001750| 20 2a 2f 0a 20 20 7b 22 | 75 6e 69 64 69 72 65 63 | */. {"|unidirec|
|00001760| 74 69 6f 6e 61 6c 2d 6e | 65 77 2d 66 69 6c 65 22 |tional-n|ew-file"|
|00001770| 2c 20 30 2c 20 30 2c 20 | 27 50 27 7d 2c 0a 20 20 |, 0, 0, |'P'},. |
|00001780| 7b 22 73 74 61 72 74 69 | 6e 67 2d 66 69 6c 65 22 |{"starti|ng-file"|
|00001790| 2c 20 31 2c 20 30 2c 20 | 27 53 27 7d 2c 0a 20 20 |, 1, 0, |'S'},. |
|000017a0| 7b 22 69 6e 69 74 69 61 | 6c 2d 74 61 62 22 2c 20 |{"initia|l-tab", |
|000017b0| 30 2c 20 30 2c 20 27 54 | 27 7d 2c 0a 20 20 7b 22 |0, 0, 'T|'},. {"|
|000017c0| 77 69 64 74 68 22 2c 20 | 31 2c 20 30 2c 20 27 57 |width", |1, 0, 'W|
|000017d0| 27 7d 2c 0a 20 20 7b 22 | 74 65 78 74 22 2c 20 30 |'},. {"|text", 0|
|000017e0| 2c 20 30 2c 20 27 61 27 | 7d 2c 0a 20 20 7b 22 61 |, 0, 'a'|},. {"a|
|000017f0| 73 63 69 69 22 2c 20 30 | 2c 20 30 2c 20 27 61 27 |scii", 0|, 0, 'a'|
|00001800| 7d 2c 09 09 2f 2a 20 41 | 6e 20 61 6c 69 61 73 2c |},../* A|n alias,|
|00001810| 20 6e 6f 20 6c 6f 6e 67 | 65 72 20 72 65 63 6f 6d | no long|er recom|
|00001820| 6d 65 6e 64 65 64 20 2a | 2f 0a 20 20 7b 22 69 67 |mended *|/. {"ig|
|00001830| 6e 6f 72 65 2d 73 70 61 | 63 65 2d 63 68 61 6e 67 |nore-spa|ce-chang|
|00001840| 65 22 2c 20 30 2c 20 30 | 2c 20 27 62 27 7d 2c 0a |e", 0, 0|, 'b'},.|
|00001850| 20 20 7b 22 6d 69 6e 69 | 6d 61 6c 22 2c 20 30 2c | {"mini|mal", 0,|
|00001860| 20 30 2c 20 27 64 27 7d | 2c 0a 20 20 7b 22 65 64 | 0, 'd'}|,. {"ed|
|00001870| 22 2c 20 30 2c 20 30 2c | 20 27 65 27 7d 2c 0a 20 |", 0, 0,| 'e'},. |
|00001880| 20 7b 22 66 6f 72 77 61 | 72 64 2d 65 64 22 2c 20 | {"forwa|rd-ed", |
|00001890| 30 2c 20 30 2c 20 27 66 | 27 7d 2c 0a 20 20 7b 22 |0, 0, 'f|'},. {"|
|000018a0| 69 67 6e 6f 72 65 2d 63 | 61 73 65 22 2c 20 30 2c |ignore-c|ase", 0,|
|000018b0| 20 30 2c 20 27 69 27 7d | 2c 0a 20 20 7b 22 70 61 | 0, 'i'}|,. {"pa|
|000018c0| 67 69 6e 61 74 65 22 2c | 20 30 2c 20 30 2c 20 27 |ginate",| 0, 0, '|
|000018d0| 6c 27 7d 2c 0a 20 20 7b | 22 70 72 69 6e 74 22 2c |l'},. {|"print",|
|000018e0| 20 30 2c 20 30 2c 20 27 | 6c 27 7d 2c 09 09 2f 2a | 0, 0, '|l'},../*|
|000018f0| 20 41 6e 20 61 6c 69 61 | 73 2c 20 6e 6f 20 6c 6f | An alia|s, no lo|
|00001900| 6e 67 65 72 20 72 65 63 | 6f 6d 6d 65 6e 64 65 64 |nger rec|ommended|
|00001910| 20 2a 2f 0a 20 20 7b 22 | 72 63 73 22 2c 20 30 2c | */. {"|rcs", 0,|
|00001920| 20 30 2c 20 27 6e 27 7d | 2c 0a 20 20 7b 22 73 68 | 0, 'n'}|,. {"sh|
|00001930| 6f 77 2d 63 2d 66 75 6e | 63 74 69 6f 6e 22 2c 20 |ow-c-fun|ction", |
|00001940| 30 2c 20 30 2c 20 27 70 | 27 7d 2c 0a 20 20 7b 22 |0, 0, 'p|'},. {"|
|00001950| 62 72 69 65 66 22 2c 20 | 30 2c 20 30 2c 20 27 71 |brief", |0, 0, 'q|
|00001960| 27 7d 2c 0a 20 20 7b 22 | 72 65 63 75 72 73 69 76 |'},. {"|recursiv|
|00001970| 65 22 2c 20 30 2c 20 30 | 2c 20 27 72 27 7d 2c 0a |e", 0, 0|, 'r'},.|
|00001980| 20 20 7b 22 72 65 70 6f | 72 74 2d 69 64 65 6e 74 | {"repo|rt-ident|
|00001990| 69 63 61 6c 2d 66 69 6c | 65 73 22 2c 20 30 2c 20 |ical-fil|es", 0, |
|000019a0| 30 2c 20 27 73 27 7d 2c | 0a 20 20 7b 22 65 78 70 |0, 's'},|. {"exp|
|000019b0| 61 6e 64 2d 74 61 62 73 | 22 2c 20 30 2c 20 30 2c |and-tabs|", 0, 0,|
|000019c0| 20 27 74 27 7d 2c 0a 20 | 20 7b 22 76 65 72 73 69 | 't'},. | {"versi|
|000019d0| 6f 6e 22 2c 20 30 2c 20 | 30 2c 20 27 76 27 7d 2c |on", 0, |0, 'v'},|
|000019e0| 0a 20 20 7b 22 69 67 6e | 6f 72 65 2d 61 6c 6c 2d |. {"ign|ore-all-|
|000019f0| 73 70 61 63 65 22 2c 20 | 30 2c 20 30 2c 20 27 77 |space", |0, 0, 'w|
|00001a00| 27 7d 2c 0a 20 20 7b 22 | 65 78 63 6c 75 64 65 22 |'},. {"|exclude"|
|00001a10| 2c 20 31 2c 20 30 2c 20 | 27 78 27 7d 2c 0a 20 20 |, 1, 0, |'x'},. |
|00001a20| 7b 22 65 78 63 6c 75 64 | 65 2d 66 72 6f 6d 22 2c |{"exclud|e-from",|
|00001a30| 20 31 2c 20 30 2c 20 27 | 58 27 7d 2c 0a 20 20 7b | 1, 0, '|X'},. {|
|00001a40| 22 73 69 64 65 2d 62 79 | 2d 73 69 64 65 22 2c 20 |"side-by|-side", |
|00001a50| 30 2c 20 30 2c 20 27 79 | 27 7d 2c 0a 20 20 7b 22 |0, 0, 'y|'},. {"|
|00001a60| 75 6e 69 66 69 65 64 22 | 2c 20 32 2c 20 30 2c 20 |unified"|, 2, 0, |
|00001a70| 27 55 27 7d 2c 0a 20 20 | 7b 22 6c 65 66 74 2d 63 |'U'},. |{"left-c|
|00001a80| 6f 6c 75 6d 6e 22 2c 20 | 30 2c 20 30 2c 20 31 32 |olumn", |0, 0, 12|
|00001a90| 39 7d 2c 0a 20 20 7b 22 | 73 75 70 70 72 65 73 73 |9},. {"|suppress|
|00001aa0| 2d 63 6f 6d 6d 6f 6e 2d | 6c 69 6e 65 73 22 2c 20 |-common-|lines", |
|00001ab0| 30 2c 20 30 2c 20 31 33 | 30 7d 2c 0a 20 20 7b 22 |0, 0, 13|0},. {"|
|00001ac0| 73 64 69 66 66 2d 6d 65 | 72 67 65 2d 61 73 73 69 |sdiff-me|rge-assi|
|00001ad0| 73 74 22 2c 20 30 2c 20 | 30 2c 20 31 33 31 7d 2c |st", 0, |0, 131},|
|00001ae0| 0a 20 20 7b 22 6f 6c 64 | 2d 6c 69 6e 65 2d 66 6f |. {"old|-line-fo|
|00001af0| 72 6d 61 74 22 2c 20 31 | 2c 20 30 2c 20 31 33 32 |rmat", 1|, 0, 132|
|00001b00| 7d 2c 0a 20 20 7b 22 6e | 65 77 2d 6c 69 6e 65 2d |},. {"n|ew-line-|
|00001b10| 66 6f 72 6d 61 74 22 2c | 20 31 2c 20 30 2c 20 31 |format",| 1, 0, 1|
|00001b20| 33 33 7d 2c 0a 20 20 7b | 22 75 6e 63 68 61 6e 67 |33},. {|"unchang|
|00001b30| 65 64 2d 6c 69 6e 65 2d | 66 6f 72 6d 61 74 22 2c |ed-line-|format",|
|00001b40| 20 31 2c 20 30 2c 20 31 | 33 34 7d 2c 0a 20 20 7b | 1, 0, 1|34},. {|
|00001b50| 22 6c 69 6e 65 2d 66 6f | 72 6d 61 74 22 2c 20 31 |"line-fo|rmat", 1|
|00001b60| 2c 20 30 2c 20 31 33 35 | 7d 2c 0a 20 20 7b 22 6f |, 0, 135|},. {"o|
|00001b70| 6c 64 2d 67 72 6f 75 70 | 2d 66 6f 72 6d 61 74 22 |ld-group|-format"|
|00001b80| 2c 20 31 2c 20 30 2c 20 | 31 33 36 7d 2c 0a 20 20 |, 1, 0, |136},. |
|00001b90| 7b 22 6e 65 77 2d 67 72 | 6f 75 70 2d 66 6f 72 6d |{"new-gr|oup-form|
|00001ba0| 61 74 22 2c 20 31 2c 20 | 30 2c 20 31 33 37 7d 2c |at", 1, |0, 137},|
|00001bb0| 0a 20 20 7b 22 75 6e 63 | 68 61 6e 67 65 64 2d 67 |. {"unc|hanged-g|
|00001bc0| 72 6f 75 70 2d 66 6f 72 | 6d 61 74 22 2c 20 31 2c |roup-for|mat", 1,|
|00001bd0| 20 30 2c 20 31 33 38 7d | 2c 0a 20 20 7b 22 63 68 | 0, 138}|,. {"ch|
|00001be0| 61 6e 67 65 64 2d 67 72 | 6f 75 70 2d 66 6f 72 6d |anged-gr|oup-form|
|00001bf0| 61 74 22 2c 20 31 2c 20 | 30 2c 20 31 33 39 7d 2c |at", 1, |0, 139},|
|00001c00| 0a 20 20 7b 22 68 6f 72 | 69 7a 6f 6e 2d 6c 69 6e |. {"hor|izon-lin|
|00001c10| 65 73 22 2c 20 31 2c 20 | 30 2c 20 31 34 30 7d 2c |es", 1, |0, 140},|
|00001c20| 0a 20 20 7b 22 68 65 6c | 70 22 2c 20 30 2c 20 30 |. {"hel|p", 0, 0|
|00001c30| 2c 20 31 34 31 7d 2c 0a | 20 20 7b 22 62 69 6e 61 |, 141},.| {"bina|
|00001c40| 72 79 22 2c 20 30 2c 20 | 30 2c 20 31 34 32 7d 2c |ry", 0, |0, 142},|
|00001c50| 0a 20 20 7b 30 2c 20 30 | 2c 20 30 2c 20 30 7d 0a |. {0, 0|, 0, 0}.|
|00001c60| 7d 3b 0a 0a 69 6e 74 0a | 6d 61 69 6e 20 28 61 72 |};..int.|main (ar|
|00001c70| 67 63 2c 20 61 72 67 76 | 29 0a 20 20 20 20 20 69 |gc, argv|). i|
|00001c80| 6e 74 20 61 72 67 63 3b | 0a 20 20 20 20 20 63 68 |nt argc;|. ch|
|00001c90| 61 72 20 2a 61 72 67 76 | 5b 5d 3b 0a 7b 0a 20 20 |ar *argv|[];.{. |
|00001ca0| 69 6e 74 20 76 61 6c 3b | 0a 20 20 69 6e 74 20 63 |int val;|. int c|
|00001cb0| 3b 0a 20 20 69 6e 74 20 | 70 72 65 76 20 3d 20 2d |;. int |prev = -|
|00001cc0| 31 3b 0a 20 20 69 6e 74 | 20 77 69 64 74 68 20 3d |1;. int| width =|
|00001cd0| 20 44 45 46 41 55 4c 54 | 5f 57 49 44 54 48 3b 0a | DEFAULT|_WIDTH;.|
|00001ce0| 20 20 69 6e 74 20 73 68 | 6f 77 5f 63 5f 66 75 6e | int sh|ow_c_fun|
|00001cf0| 63 74 69 6f 6e 20 3d 20 | 30 3b 0a 0a 20 20 2f 2a |ction = |0;.. /*|
|00001d00| 20 44 6f 20 6f 75 72 20 | 69 6e 69 74 69 61 6c 69 | Do our |initiali|
|00001d10| 7a 61 74 69 6f 6e 73 2e | 20 20 2a 2f 0a 20 20 69 |zations.| */. i|
|00001d20| 6e 69 74 69 61 6c 69 7a | 65 5f 6d 61 69 6e 20 28 |nitializ|e_main (|
|00001d30| 26 61 72 67 63 2c 20 26 | 61 72 67 76 29 3b 0a 20 |&argc, &|argv);. |
|00001d40| 20 70 72 6f 67 72 61 6d | 5f 6e 61 6d 65 20 3d 20 | program|_name = |
|00001d50| 61 72 67 76 5b 30 5d 3b | 0a 20 20 6f 75 74 70 75 |argv[0];|. outpu|
|00001d60| 74 5f 73 74 79 6c 65 20 | 3d 20 4f 55 54 50 55 54 |t_style |= OUTPUT|
|00001d70| 5f 4e 4f 52 4d 41 4c 3b | 0a 20 20 63 6f 6e 74 65 |_NORMAL;|. conte|
|00001d80| 78 74 20 3d 20 2d 31 3b | 0a 0a 20 20 2f 2a 20 44 |xt = -1;|.. /* D|
|00001d90| 65 63 6f 64 65 20 74 68 | 65 20 6f 70 74 69 6f 6e |ecode th|e option|
|00001da0| 73 2e 20 20 2a 2f 0a 0a | 20 20 77 68 69 6c 65 20 |s. */..| while |
|00001db0| 28 28 63 20 3d 20 67 65 | 74 6f 70 74 5f 6c 6f 6e |((c = ge|topt_lon|
|00001dc0| 67 20 28 61 72 67 63 2c | 20 61 72 67 76 2c 0a 09 |g (argc,| argv,..|
|00001dd0| 09 09 20 20 20 22 30 31 | 32 33 34 35 36 37 38 39 |.. "01|23456789|
|00001de0| 61 62 42 63 43 3a 64 44 | 3a 65 66 46 3a 68 48 69 |abBcC:dD|:efF:hHi|
|00001df0| 49 3a 6c 4c 3a 6e 4e 70 | 50 71 72 73 53 3a 74 54 |I:lL:nNp|PqrsS:tT|
|00001e00| 75 55 3a 76 77 57 3a 78 | 3a 58 3a 79 22 2c 0a 09 |uU:vwW:x|:X:y",..|
|00001e10| 09 09 20 20 20 6c 6f 6e | 67 6f 70 74 73 2c 20 30 |.. lon|gopts, 0|
|00001e20| 29 29 20 21 3d 20 45 4f | 46 29 0a 20 20 20 20 7b |)) != EO|F). {|
|00001e30| 0a 20 20 20 20 20 20 73 | 77 69 74 63 68 20 28 63 |. s|witch (c|
|00001e40| 29 0a 09 7b 0a 09 20 20 | 2f 2a 20 41 6c 6c 20 64 |)..{.. |/* All d|
|00001e50| 69 67 69 74 73 20 63 6f | 6d 62 69 6e 65 20 69 6e |igits co|mbine in|
|00001e60| 20 64 65 63 69 6d 61 6c | 20 74 6f 20 73 70 65 63 | decimal| to spec|
|00001e70| 69 66 79 20 74 68 65 20 | 63 6f 6e 74 65 78 74 2d |ify the |context-|
|00001e80| 73 69 7a 65 2e 20 20 2a | 2f 0a 09 63 61 73 65 20 |size. *|/..case |
|00001e90| 27 31 27 3a 0a 09 63 61 | 73 65 20 27 32 27 3a 0a |'1':..ca|se '2':.|
|00001ea0| 09 63 61 73 65 20 27 33 | 27 3a 0a 09 63 61 73 65 |.case '3|':..case|
|00001eb0| 20 27 34 27 3a 0a 09 63 | 61 73 65 20 27 35 27 3a | '4':..c|ase '5':|
|00001ec0| 0a 09 63 61 73 65 20 27 | 36 27 3a 0a 09 63 61 73 |..case '|6':..cas|
|00001ed0| 65 20 27 37 27 3a 0a 09 | 63 61 73 65 20 27 38 27 |e '7':..|case '8'|
|00001ee0| 3a 0a 09 63 61 73 65 20 | 27 39 27 3a 0a 09 63 61 |:..case |'9':..ca|
|00001ef0| 73 65 20 27 30 27 3a 0a | 09 20 20 69 66 20 28 63 |se '0':.|. if (c|
|00001f00| 6f 6e 74 65 78 74 20 3d | 3d 20 2d 31 29 0a 09 20 |ontext =|= -1).. |
|00001f10| 20 20 20 63 6f 6e 74 65 | 78 74 20 3d 20 30 3b 0a | conte|xt = 0;.|
|00001f20| 09 20 20 2f 2a 20 49 66 | 20 61 20 63 6f 6e 74 65 |. /* If| a conte|
|00001f30| 78 74 20 6c 65 6e 67 74 | 68 20 68 61 73 20 61 6c |xt lengt|h has al|
|00001f40| 72 65 61 64 79 20 62 65 | 65 6e 20 73 70 65 63 69 |ready be|en speci|
|00001f50| 66 69 65 64 2c 0a 09 20 | 20 20 20 20 6d 6f 72 65 |fied,.. | more|
|00001f60| 20 64 69 67 69 74 73 20 | 61 6c 6c 6f 77 65 64 20 | digits |allowed |
|00001f70| 6f 6e 6c 79 20 69 66 20 | 74 68 65 79 20 66 6f 6c |only if |they fol|
|00001f80| 6c 6f 77 20 72 69 67 68 | 74 20 61 66 74 65 72 20 |low righ|t after |
|00001f90| 74 68 65 20 6f 74 68 65 | 72 73 2e 0a 09 20 20 20 |the othe|rs... |
|00001fa0| 20 20 52 65 6a 65 63 74 | 20 74 77 6f 20 73 65 70 | Reject| two sep|
|00001fb0| 61 72 61 74 65 20 72 75 | 6e 73 20 6f 66 20 64 69 |arate ru|ns of di|
|00001fc0| 67 69 74 73 2c 20 6f 72 | 20 64 69 67 69 74 73 20 |gits, or| digits |
|00001fd0| 61 66 74 65 72 20 2d 43 | 2e 20 20 2a 2f 0a 09 20 |after -C|. */.. |
|00001fe0| 20 65 6c 73 65 20 69 66 | 20 28 70 72 65 76 20 3c | else if| (prev <|
|00001ff0| 20 27 30 27 20 7c 7c 20 | 70 72 65 76 20 3e 20 27 | '0' || |prev > '|
|00002000| 39 27 29 0a 09 20 20 20 | 20 66 61 74 61 6c 20 28 |9').. | fatal (|
|00002010| 22 63 6f 6e 74 65 78 74 | 20 6c 65 6e 67 74 68 20 |"context| length |
|00002020| 73 70 65 63 69 66 69 65 | 64 20 74 77 69 63 65 22 |specifie|d twice"|
|00002030| 29 3b 0a 0a 09 20 20 63 | 6f 6e 74 65 78 74 20 3d |);... c|ontext =|
|00002040| 20 63 6f 6e 74 65 78 74 | 20 2a 20 31 30 20 2b 20 | context| * 10 + |
|00002050| 63 20 2d 20 27 30 27 3b | 0a 09 20 20 62 72 65 61 |c - '0';|.. brea|
|00002060| 6b 3b 0a 0a 09 63 61 73 | 65 20 27 61 27 3a 0a 09 |k;...cas|e 'a':..|
|00002070| 20 20 2f 2a 20 54 72 65 | 61 74 20 61 6c 6c 20 66 | /* Tre|at all f|
|00002080| 69 6c 65 73 20 61 73 20 | 74 65 78 74 20 66 69 6c |iles as |text fil|
|00002090| 65 73 3b 20 6e 65 76 65 | 72 20 74 72 65 61 74 20 |es; neve|r treat |
|000020a0| 61 73 20 62 69 6e 61 72 | 79 2e 20 20 2a 2f 0a 09 |as binar|y. */..|
|000020b0| 20 20 61 6c 77 61 79 73 | 5f 74 65 78 74 5f 66 6c | always|_text_fl|
|000020c0| 61 67 20 3d 20 31 3b 0a | 09 20 20 62 72 65 61 6b |ag = 1;.|. break|
|000020d0| 3b 0a 0a 09 63 61 73 65 | 20 27 62 27 3a 0a 09 20 |;...case| 'b':.. |
|000020e0| 20 2f 2a 20 49 67 6e 6f | 72 65 20 63 68 61 6e 67 | /* Igno|re chang|
|000020f0| 65 73 20 69 6e 20 61 6d | 6f 75 6e 74 20 6f 66 20 |es in am|ount of |
|00002100| 77 68 69 74 65 20 73 70 | 61 63 65 2e 20 20 2a 2f |white sp|ace. */|
|00002110| 0a 09 20 20 69 67 6e 6f | 72 65 5f 73 70 61 63 65 |.. igno|re_space|
|00002120| 5f 63 68 61 6e 67 65 5f | 66 6c 61 67 20 3d 20 31 |_change_|flag = 1|
|00002130| 3b 0a 09 20 20 69 67 6e | 6f 72 65 5f 73 6f 6d 65 |;.. ign|ore_some|
|00002140| 5f 63 68 61 6e 67 65 73 | 20 3d 20 31 3b 0a 09 20 |_changes| = 1;.. |
|00002150| 20 69 67 6e 6f 72 65 5f | 73 6f 6d 65 5f 6c 69 6e | ignore_|some_lin|
|00002160| 65 5f 63 68 61 6e 67 65 | 73 20 3d 20 31 3b 0a 09 |e_change|s = 1;..|
|00002170| 20 20 62 72 65 61 6b 3b | 0a 0a 09 63 61 73 65 20 | break;|...case |
|00002180| 27 42 27 3a 0a 09 20 20 | 2f 2a 20 49 67 6e 6f 72 |'B':.. |/* Ignor|
|00002190| 65 20 63 68 61 6e 67 65 | 73 20 61 66 66 65 63 74 |e change|s affect|
|000021a0| 69 6e 67 20 6f 6e 6c 79 | 20 62 6c 61 6e 6b 20 6c |ing only| blank l|
|000021b0| 69 6e 65 73 2e 20 20 2a | 2f 0a 09 20 20 69 67 6e |ines. *|/.. ign|
|000021c0| 6f 72 65 5f 62 6c 61 6e | 6b 5f 6c 69 6e 65 73 5f |ore_blan|k_lines_|
|000021d0| 66 6c 61 67 20 3d 20 31 | 3b 0a 09 20 20 69 67 6e |flag = 1|;.. ign|
|000021e0| 6f 72 65 5f 73 6f 6d 65 | 5f 63 68 61 6e 67 65 73 |ore_some|_changes|
|000021f0| 20 3d 20 31 3b 0a 09 20 | 20 62 72 65 61 6b 3b 0a | = 1;.. | break;.|
|00002200| 0a 09 63 61 73 65 20 27 | 43 27 3a 09 09 2f 2a 20 |..case '|C':../* |
|00002210| 2b 63 6f 6e 74 65 78 74 | 5b 3d 6c 69 6e 65 73 5d |+context|[=lines]|
|00002220| 20 2a 2f 0a 09 63 61 73 | 65 20 27 55 27 3a 09 09 | */..cas|e 'U':..|
|00002230| 2f 2a 20 2b 75 6e 69 66 | 69 65 64 5b 3d 6c 69 6e |/* +unif|ied[=lin|
|00002240| 65 73 5d 20 2a 2f 0a 09 | 20 20 69 66 20 28 6f 70 |es] */..| if (op|
|00002250| 74 61 72 67 29 0a 09 20 | 20 20 20 7b 0a 09 20 20 |targ).. | {.. |
|00002260| 20 20 20 20 69 66 20 28 | 63 6f 6e 74 65 78 74 20 | if (|context |
|00002270| 3e 3d 20 30 29 0a 09 09 | 66 61 74 61 6c 20 28 22 |>= 0)...|fatal ("|
|00002280| 63 6f 6e 74 65 78 74 20 | 6c 65 6e 67 74 68 20 73 |context |length s|
|00002290| 70 65 63 69 66 69 65 64 | 20 74 77 69 63 65 22 29 |pecified| twice")|
|000022a0| 3b 0a 0a 09 20 20 20 20 | 20 20 69 66 20 28 63 6b |;... | if (ck|
|000022b0| 5f 61 74 6f 69 20 28 6f | 70 74 61 72 67 2c 20 26 |_atoi (o|ptarg, &|
|000022c0| 63 6f 6e 74 65 78 74 29 | 29 0a 09 09 66 61 74 61 |context)|)...fata|
|000022d0| 6c 20 28 22 69 6e 76 61 | 6c 69 64 20 63 6f 6e 74 |l ("inva|lid cont|
|000022e0| 65 78 74 20 6c 65 6e 67 | 74 68 20 61 72 67 75 6d |ext leng|th argum|
|000022f0| 65 6e 74 22 29 3b 0a 09 | 20 20 20 20 7d 0a 0a 09 |ent");..| }...|
|00002300| 20 20 2f 2a 20 46 61 6c | 6c 73 20 74 68 72 6f 75 | /* Fal|ls throu|
|00002310| 67 68 2e 20 20 2a 2f 0a | 09 63 61 73 65 20 27 63 |gh. */.|.case 'c|
|00002320| 27 3a 0a 09 20 20 2f 2a | 20 4d 61 6b 65 20 63 6f |':.. /*| Make co|
|00002330| 6e 74 65 78 74 2d 73 74 | 79 6c 65 20 6f 75 74 70 |ntext-st|yle outp|
|00002340| 75 74 2e 20 20 2a 2f 0a | 09 20 20 73 70 65 63 69 |ut. */.|. speci|
|00002350| 66 79 5f 73 74 79 6c 65 | 20 28 63 20 3d 3d 20 27 |fy_style| (c == '|
|00002360| 55 27 20 3f 20 4f 55 54 | 50 55 54 5f 55 4e 49 46 |U' ? OUT|PUT_UNIF|
|00002370| 49 45 44 20 3a 20 4f 55 | 54 50 55 54 5f 43 4f 4e |IED : OU|TPUT_CON|
|00002380| 54 45 58 54 29 3b 0a 09 | 20 20 62 72 65 61 6b 3b |TEXT);..| break;|
|00002390| 0a 0a 09 63 61 73 65 20 | 27 64 27 3a 0a 09 20 20 |...case |'d':.. |
|000023a0| 2f 2a 20 44 6f 6e 27 74 | 20 64 69 73 63 61 72 64 |/* Don't| discard|
|000023b0| 20 6c 69 6e 65 73 2e 20 | 20 54 68 69 73 20 6d 61 | lines. | This ma|
|000023c0| 6b 65 73 20 74 68 69 6e | 67 73 20 73 6c 6f 77 65 |kes thin|gs slowe|
|000023d0| 72 20 28 73 6f 6d 65 74 | 69 6d 65 73 20 6d 75 63 |r (somet|imes muc|
|000023e0| 68 0a 09 20 20 20 20 20 | 73 6c 6f 77 65 72 29 20 |h.. |slower) |
|000023f0| 62 75 74 20 77 69 6c 6c | 20 66 69 6e 64 20 61 20 |but will| find a |
|00002400| 67 75 61 72 61 6e 74 65 | 65 64 20 6d 69 6e 69 6d |guarante|ed minim|
|00002410| 61 6c 20 73 65 74 20 6f | 66 20 63 68 61 6e 67 65 |al set o|f change|
|00002420| 73 2e 20 20 2a 2f 0a 09 | 20 20 6e 6f 5f 64 69 73 |s. */..| no_dis|
|00002430| 63 61 72 64 73 20 3d 20 | 31 3b 0a 09 20 20 62 72 |cards = |1;.. br|
|00002440| 65 61 6b 3b 0a 0a 09 63 | 61 73 65 20 27 44 27 3a |eak;...c|ase 'D':|
|00002450| 0a 09 20 20 2f 2a 20 4d | 61 6b 65 20 6d 65 72 67 |.. /* M|ake merg|
|00002460| 65 64 20 23 69 66 64 65 | 66 20 6f 75 74 70 75 74 |ed #ifde|f output|
|00002470| 2e 20 20 2a 2f 0a 09 20 | 20 73 70 65 63 69 66 79 |. */.. | specify|
|00002480| 5f 73 74 79 6c 65 20 28 | 4f 55 54 50 55 54 5f 49 |_style (|OUTPUT_I|
|00002490| 46 44 45 46 29 3b 0a 09 | 20 20 7b 0a 09 20 20 20 |FDEF);..| {.. |
|000024a0| 20 69 6e 74 20 69 2c 20 | 65 72 72 20 3d 20 30 3b | int i, |err = 0;|
|000024b0| 0a 09 20 20 20 20 73 74 | 61 74 69 63 20 63 68 61 |.. st|atic cha|
|000024c0| 72 20 63 6f 6e 73 74 20 | 43 5f 69 66 64 65 66 5f |r const |C_ifdef_|
|000024d0| 67 72 6f 75 70 5f 66 6f | 72 6d 61 74 73 5b 5d 20 |group_fo|rmats[] |
|000024e0| 3d 0a 09 20 20 20 20 20 | 20 22 23 69 66 6e 64 65 |=.. | "#ifnde|
|000024f0| 66 20 25 73 5c 6e 25 25 | 3c 23 65 6e 64 69 66 20 |f %s\n%%|<#endif |
|00002500| 2f 2a 20 6e 6f 74 20 25 | 73 20 2a 2f 5c 6e 25 63 |/* not %|s */\n%c|
|00002510| 23 69 66 64 65 66 20 25 | 73 5c 6e 25 25 3e 23 65 |#ifdef %|s\n%%>#e|
|00002520| 6e 64 69 66 20 2f 2a 20 | 25 73 20 2a 2f 5c 6e 25 |ndif /* |%s */\n%|
|00002530| 63 25 25 3d 25 63 23 69 | 66 6e 64 65 66 20 25 73 |c%%=%c#i|fndef %s|
|00002540| 5c 6e 25 25 3c 23 65 6c | 73 65 20 2f 2a 20 25 73 |\n%%<#el|se /* %s|
|00002550| 20 2a 2f 5c 6e 25 25 3e | 23 65 6e 64 69 66 20 2f | */\n%%>|#endif /|
|00002560| 2a 20 25 73 20 2a 2f 5c | 6e 22 3b 0a 09 20 20 20 |* %s */\|n";.. |
|00002570| 20 63 68 61 72 20 2a 62 | 20 3d 20 78 6d 61 6c 6c | char *b| = xmall|
|00002580| 6f 63 20 28 73 69 7a 65 | 6f 66 20 28 43 5f 69 66 |oc (size|of (C_if|
|00002590| 64 65 66 5f 67 72 6f 75 | 70 5f 66 6f 72 6d 61 74 |def_grou|p_format|
|000025a0| 73 29 0a 09 09 09 20 20 | 20 20 20 20 20 2b 20 37 |s).... | + 7|
|000025b0| 20 2a 20 73 74 72 6c 65 | 6e 28 6f 70 74 61 72 67 | * strle|n(optarg|
|000025c0| 29 20 2d 20 31 34 20 2f | 2a 20 37 2a 22 25 73 22 |) - 14 /|* 7*"%s"|
|000025d0| 20 2a 2f 0a 09 09 09 20 | 20 20 20 20 20 20 2d 20 | */.... | - |
|000025e0| 38 20 2f 2a 20 35 2a 22 | 25 25 22 20 2b 20 33 2a |8 /* 5*"|%%" + 3*|
|000025f0| 22 25 63 22 20 2a 2f 29 | 3b 0a 09 20 20 20 20 73 |"%c" */)|;.. s|
|00002600| 70 72 69 6e 74 66 20 28 | 62 2c 20 43 5f 69 66 64 |printf (|b, C_ifd|
|00002610| 65 66 5f 67 72 6f 75 70 | 5f 66 6f 72 6d 61 74 73 |ef_group|_formats|
|00002620| 2c 0a 09 09 20 20 20 20 | 20 6f 70 74 61 72 67 2c |,... | optarg,|
|00002630| 20 6f 70 74 61 72 67 2c | 20 30 2c 0a 09 09 20 20 | optarg,| 0,... |
|00002640| 20 20 20 6f 70 74 61 72 | 67 2c 20 6f 70 74 61 72 | optar|g, optar|
|00002650| 67 2c 20 30 2c 20 30 2c | 0a 09 09 20 20 20 20 20 |g, 0, 0,|... |
|00002660| 6f 70 74 61 72 67 2c 20 | 6f 70 74 61 72 67 2c 20 |optarg, |optarg, |
|00002670| 6f 70 74 61 72 67 29 3b | 0a 09 20 20 20 20 66 6f |optarg);|.. fo|
|00002680| 72 20 28 69 20 3d 20 30 | 3b 20 69 20 3c 20 34 3b |r (i = 0|; i < 4;|
|00002690| 20 69 2b 2b 29 0a 09 20 | 20 20 20 20 20 7b 0a 09 | i++).. | {..|
|000026a0| 09 65 72 72 20 7c 3d 20 | 73 70 65 63 69 66 79 5f |.err |= |specify_|
|000026b0| 66 6f 72 6d 61 74 20 28 | 26 67 72 6f 75 70 5f 66 |format (|&group_f|
|000026c0| 6f 72 6d 61 74 5b 69 5d | 2c 20 62 29 3b 0a 09 09 |ormat[i]|, b);...|
|000026d0| 62 20 2b 3d 20 73 74 72 | 6c 65 6e 20 28 62 29 20 |b += str|len (b) |
|000026e0| 2b 20 31 3b 0a 09 20 20 | 20 20 20 20 7d 0a 09 20 |+ 1;.. | }.. |
|000026f0| 20 20 20 69 66 20 28 65 | 72 72 29 0a 09 20 20 20 | if (e|rr).. |
|00002700| 20 20 20 65 72 72 6f 72 | 20 28 22 63 6f 6e 66 6c | error| ("confl|
|00002710| 69 63 74 69 6e 67 20 23 | 69 66 64 65 66 20 66 6f |icting #|ifdef fo|
|00002720| 72 6d 61 74 73 22 2c 20 | 30 2c 20 30 29 3b 0a 09 |rmats", |0, 0);..|
|00002730| 20 20 7d 0a 09 20 20 62 | 72 65 61 6b 3b 0a 0a 09 | }.. b|reak;...|
|00002740| 63 61 73 65 20 27 65 27 | 3a 0a 09 20 20 2f 2a 20 |case 'e'|:.. /* |
|00002750| 4d 61 6b 65 20 6f 75 74 | 70 75 74 20 74 68 61 74 |Make out|put that|
|00002760| 20 69 73 20 61 20 76 61 | 6c 69 64 20 60 65 64 27 | is a va|lid `ed'|
|00002770| 20 73 63 72 69 70 74 2e | 20 20 2a 2f 0a 09 20 20 | script.| */.. |
|00002780| 73 70 65 63 69 66 79 5f | 73 74 79 6c 65 20 28 4f |specify_|style (O|
|00002790| 55 54 50 55 54 5f 45 44 | 29 3b 0a 09 20 20 62 72 |UTPUT_ED|);.. br|
|000027a0| 65 61 6b 3b 0a 0a 09 63 | 61 73 65 20 27 66 27 3a |eak;...c|ase 'f':|
|000027b0| 0a 09 20 20 2f 2a 20 4d | 61 6b 65 20 6f 75 74 70 |.. /* M|ake outp|
|000027c0| 75 74 20 74 68 61 74 20 | 6c 6f 6f 6b 73 20 76 61 |ut that |looks va|
|000027d0| 67 75 65 6c 79 20 6c 69 | 6b 65 20 61 6e 20 60 65 |guely li|ke an `e|
|000027e0| 64 27 20 73 63 72 69 70 | 74 0a 09 20 20 20 20 20 |d' scrip|t.. |
|000027f0| 62 75 74 20 68 61 73 20 | 63 68 61 6e 67 65 73 20 |but has |changes |
|00002800| 69 6e 20 74 68 65 20 6f | 72 64 65 72 20 74 68 65 |in the o|rder the|
|00002810| 79 20 61 70 70 65 61 72 | 20 69 6e 20 74 68 65 20 |y appear| in the |
|00002820| 66 69 6c 65 2e 20 20 2a | 2f 0a 09 20 20 73 70 65 |file. *|/.. spe|
|00002830| 63 69 66 79 5f 73 74 79 | 6c 65 20 28 4f 55 54 50 |cify_sty|le (OUTP|
|00002840| 55 54 5f 46 4f 52 57 41 | 52 44 5f 45 44 29 3b 0a |UT_FORWA|RD_ED);.|
|00002850| 09 20 20 62 72 65 61 6b | 3b 0a 0a 09 63 61 73 65 |. break|;...case|
|00002860| 20 27 46 27 3a 0a 09 20 | 20 2f 2a 20 53 68 6f 77 | 'F':.. | /* Show|
|00002870| 2c 20 66 6f 72 20 65 61 | 63 68 20 73 65 74 20 6f |, for ea|ch set o|
|00002880| 66 20 63 68 61 6e 67 65 | 73 2c 20 74 68 65 20 70 |f change|s, the p|
|00002890| 72 65 76 69 6f 75 73 20 | 6c 69 6e 65 20 74 68 61 |revious |line tha|
|000028a0| 74 0a 09 20 20 20 20 20 | 6d 61 74 63 68 65 73 20 |t.. |matches |
|000028b0| 74 68 65 20 73 70 65 63 | 69 66 69 65 64 20 72 65 |the spec|ified re|
|000028c0| 67 65 78 70 2e 20 20 43 | 75 72 72 65 6e 74 6c 79 |gexp. C|urrently|
|000028d0| 20 61 66 66 65 63 74 73 | 20 6f 6e 6c 79 0a 09 20 | affects| only.. |
|000028e0| 20 20 20 20 63 6f 6e 74 | 65 78 74 2d 73 74 79 6c | cont|ext-styl|
|000028f0| 65 20 6f 75 74 70 75 74 | 2e 20 20 2a 2f 0a 09 20 |e output|. */.. |
|00002900| 20 61 64 64 5f 72 65 67 | 65 78 70 20 28 26 66 75 | add_reg|exp (&fu|
|00002910| 6e 63 74 69 6f 6e 5f 72 | 65 67 65 78 70 5f 6c 69 |nction_r|egexp_li|
|00002920| 73 74 2c 20 6f 70 74 61 | 72 67 29 3b 0a 09 20 20 |st, opta|rg);.. |
|00002930| 62 72 65 61 6b 3b 0a 0a | 09 63 61 73 65 20 27 68 |break;..|.case 'h|
|00002940| 27 3a 0a 09 20 20 2f 2a | 20 53 70 6c 69 74 20 74 |':.. /*| Split t|
|00002950| 68 65 20 66 69 6c 65 73 | 20 69 6e 74 6f 20 63 68 |he files| into ch|
|00002960| 75 6e 6b 73 20 6f 66 20 | 61 72 6f 75 6e 64 20 31 |unks of |around 1|
|00002970| 35 30 30 20 6c 69 6e 65 | 73 0a 09 20 20 20 20 20 |500 line|s.. |
|00002980| 66 6f 72 20 66 61 73 74 | 65 72 20 70 72 6f 63 65 |for fast|er proce|
|00002990| 73 73 69 6e 67 2e 20 20 | 55 73 75 61 6c 6c 79 20 |ssing. |Usually |
|000029a0| 64 6f 65 73 20 6e 6f 74 | 20 63 68 61 6e 67 65 20 |does not| change |
|000029b0| 74 68 65 20 72 65 73 75 | 6c 74 2e 0a 0a 09 20 20 |the resu|lt.... |
|000029c0| 20 20 20 54 68 69 73 20 | 63 75 72 72 65 6e 74 6c | This |currentl|
|000029d0| 79 20 68 61 73 20 6e 6f | 20 65 66 66 65 63 74 2e |y has no| effect.|
|000029e0| 20 20 2a 2f 0a 09 20 20 | 62 72 65 61 6b 3b 0a 0a | */.. |break;..|
|000029f0| 09 63 61 73 65 20 27 48 | 27 3a 0a 09 20 20 2f 2a |.case 'H|':.. /*|
|00002a00| 20 54 75 72 6e 20 6f 6e | 20 68 65 75 72 69 73 74 | Turn on| heurist|
|00002a10| 69 63 73 20 74 68 61 74 | 20 73 70 65 65 64 20 70 |ics that| speed p|
|00002a20| 72 6f 63 65 73 73 69 6e | 67 20 6f 66 20 6c 61 72 |rocessin|g of lar|
|00002a30| 67 65 20 66 69 6c 65 73 | 0a 09 20 20 20 20 20 77 |ge files|.. w|
|00002a40| 69 74 68 20 61 20 73 6d | 61 6c 6c 20 64 65 6e 73 |ith a sm|all dens|
|00002a50| 69 74 79 20 6f 66 20 63 | 68 61 6e 67 65 73 2e 20 |ity of c|hanges. |
|00002a60| 20 2a 2f 0a 09 20 20 68 | 65 75 72 69 73 74 69 63 | */.. h|euristic|
|00002a70| 20 3d 20 31 3b 0a 09 20 | 20 62 72 65 61 6b 3b 0a | = 1;.. | break;.|
|00002a80| 0a 09 63 61 73 65 20 27 | 69 27 3a 0a 09 20 20 2f |..case '|i':.. /|
|00002a90| 2a 20 49 67 6e 6f 72 65 | 20 63 68 61 6e 67 65 73 |* Ignore| changes|
|00002aa0| 20 69 6e 20 63 61 73 65 | 2e 20 20 2a 2f 0a 09 20 | in case|. */.. |
|00002ab0| 20 69 67 6e 6f 72 65 5f | 63 61 73 65 5f 66 6c 61 | ignore_|case_fla|
|00002ac0| 67 20 3d 20 31 3b 0a 09 | 20 20 69 67 6e 6f 72 65 |g = 1;..| ignore|
|00002ad0| 5f 73 6f 6d 65 5f 63 68 | 61 6e 67 65 73 20 3d 20 |_some_ch|anges = |
|00002ae0| 31 3b 0a 09 20 20 69 67 | 6e 6f 72 65 5f 73 6f 6d |1;.. ig|nore_som|
|00002af0| 65 5f 6c 69 6e 65 5f 63 | 68 61 6e 67 65 73 20 3d |e_line_c|hanges =|
|00002b00| 20 31 3b 0a 09 20 20 62 | 72 65 61 6b 3b 0a 0a 09 | 1;.. b|reak;...|
|00002b10| 63 61 73 65 20 27 49 27 | 3a 0a 09 20 20 2f 2a 20 |case 'I'|:.. /* |
|00002b20| 49 67 6e 6f 72 65 20 63 | 68 61 6e 67 65 73 20 61 |Ignore c|hanges a|
|00002b30| 66 66 65 63 74 69 6e 67 | 20 6f 6e 6c 79 20 6c 69 |ffecting| only li|
|00002b40| 6e 65 73 20 74 68 61 74 | 20 6d 61 74 63 68 20 74 |nes that| match t|
|00002b50| 68 65 0a 09 20 20 20 20 | 20 73 70 65 63 69 66 69 |he.. | specifi|
|00002b60| 65 64 20 72 65 67 65 78 | 70 2e 20 20 2a 2f 0a 09 |ed regex|p. */..|
|00002b70| 20 20 61 64 64 5f 72 65 | 67 65 78 70 20 28 26 69 | add_re|gexp (&i|
|00002b80| 67 6e 6f 72 65 5f 72 65 | 67 65 78 70 5f 6c 69 73 |gnore_re|gexp_lis|
|00002b90| 74 2c 20 6f 70 74 61 72 | 67 29 3b 0a 09 20 20 69 |t, optar|g);.. i|
|00002ba0| 67 6e 6f 72 65 5f 73 6f | 6d 65 5f 63 68 61 6e 67 |gnore_so|me_chang|
|00002bb0| 65 73 20 3d 20 31 3b 0a | 09 20 20 62 72 65 61 6b |es = 1;.|. break|
|00002bc0| 3b 0a 0a 09 63 61 73 65 | 20 27 6c 27 3a 0a 09 20 |;...case| 'l':.. |
|00002bd0| 20 2f 2a 20 50 61 73 73 | 20 74 68 65 20 6f 75 74 | /* Pass| the out|
|00002be0| 70 75 74 20 74 68 72 6f | 75 67 68 20 60 70 72 27 |put thro|ugh `pr'|
|00002bf0| 20 74 6f 20 70 61 67 69 | 6e 61 74 65 20 69 74 2e | to pagi|nate it.|
|00002c00| 20 20 2a 2f 0a 09 20 20 | 70 61 67 69 6e 61 74 65 | */.. |paginate|
|00002c10| 5f 66 6c 61 67 20 3d 20 | 31 3b 0a 23 69 66 20 21 |_flag = |1;.#if !|
|00002c20| 64 65 66 69 6e 65 64 28 | 53 49 47 43 48 4c 44 29 |defined(|SIGCHLD)|
|00002c30| 20 26 26 20 64 65 66 69 | 6e 65 64 28 53 49 47 43 | && defi|ned(SIGC|
|00002c40| 4c 44 29 0a 23 64 65 66 | 69 6e 65 20 53 49 47 43 |LD).#def|ine SIGC|
|00002c50| 48 4c 44 20 53 49 47 43 | 4c 44 0a 23 65 6e 64 69 |HLD SIGC|LD.#endi|
|00002c60| 66 0a 23 69 66 64 65 66 | 20 53 49 47 43 48 4c 44 |f.#ifdef| SIGCHLD|
|00002c70| 0a 09 20 20 2f 2a 20 50 | 61 67 69 6e 61 74 69 6f |.. /* P|aginatio|
|00002c80| 6e 20 72 65 71 75 69 72 | 65 73 20 66 6f 72 6b 69 |n requir|es forki|
|00002c90| 6e 67 20 61 6e 64 20 77 | 61 69 74 69 6e 67 2c 20 |ng and w|aiting, |
|00002ca0| 61 6e 64 0a 09 20 20 20 | 20 20 53 79 73 74 65 6d |and.. | System|
|00002cb0| 20 56 20 66 6f 72 6b 2b | 77 61 69 74 20 64 6f 65 | V fork+|wait doe|
|00002cc0| 73 20 6e 6f 74 20 77 6f | 72 6b 20 69 66 20 53 49 |s not wo|rk if SI|
|00002cd0| 47 43 48 4c 44 20 69 73 | 20 69 67 6e 6f 72 65 64 |GCHLD is| ignored|
|00002ce0| 2e 20 20 2a 2f 0a 09 20 | 20 73 69 67 6e 61 6c 20 |. */.. | signal |
|00002cf0| 28 53 49 47 43 48 4c 44 | 2c 20 53 49 47 5f 44 46 |(SIGCHLD|, SIG_DF|
|00002d00| 4c 29 3b 0a 23 65 6e 64 | 69 66 0a 09 20 20 62 72 |L);.#end|if.. br|
|00002d10| 65 61 6b 3b 0a 0a 09 63 | 61 73 65 20 27 4c 27 3a |eak;...c|ase 'L':|
|00002d20| 0a 09 20 20 2f 2a 20 53 | 70 65 63 69 66 79 20 66 |.. /* S|pecify f|
|00002d30| 69 6c 65 20 6c 61 62 65 | 6c 73 20 66 6f 72 20 60 |ile labe|ls for `|
|00002d40| 2d 63 27 20 6f 75 74 70 | 75 74 20 68 65 61 64 65 |-c' outp|ut heade|
|00002d50| 72 73 2e 20 20 2a 2f 0a | 09 20 20 69 66 20 28 21 |rs. */.|. if (!|
|00002d60| 66 69 6c 65 5f 6c 61 62 | 65 6c 5b 30 5d 29 0a 09 |file_lab|el[0])..|
|00002d70| 20 20 20 20 66 69 6c 65 | 5f 6c 61 62 65 6c 5b 30 | file|_label[0|
|00002d80| 5d 20 3d 20 6f 70 74 61 | 72 67 3b 0a 09 20 20 65 |] = opta|rg;.. e|
|00002d90| 6c 73 65 20 69 66 20 28 | 21 66 69 6c 65 5f 6c 61 |lse if (|!file_la|
|00002da0| 62 65 6c 5b 31 5d 29 0a | 09 20 20 20 20 66 69 6c |bel[1]).|. fil|
|00002db0| 65 5f 6c 61 62 65 6c 5b | 31 5d 20 3d 20 6f 70 74 |e_label[|1] = opt|
|00002dc0| 61 72 67 3b 0a 09 20 20 | 65 6c 73 65 0a 09 20 20 |arg;.. |else.. |
|00002dd0| 20 20 66 61 74 61 6c 20 | 28 22 74 6f 6f 20 6d 61 | fatal |("too ma|
|00002de0| 6e 79 20 66 69 6c 65 20 | 6c 61 62 65 6c 20 6f 70 |ny file |label op|
|00002df0| 74 69 6f 6e 73 22 29 3b | 0a 09 20 20 62 72 65 61 |tions");|.. brea|
|00002e00| 6b 3b 0a 0a 09 63 61 73 | 65 20 27 6e 27 3a 0a 09 |k;...cas|e 'n':..|
|00002e10| 20 20 2f 2a 20 4f 75 74 | 70 75 74 20 52 43 53 2d | /* Out|put RCS-|
|00002e20| 73 74 79 6c 65 20 64 69 | 66 66 73 2c 20 6c 69 6b |style di|ffs, lik|
|00002e30| 65 20 60 2d 66 27 20 65 | 78 63 65 70 74 20 74 68 |e `-f' e|xcept th|
|00002e40| 61 74 20 65 61 63 68 20 | 63 6f 6d 6d 61 6e 64 0a |at each |command.|
|00002e50| 09 20 20 20 20 20 73 70 | 65 63 69 66 69 65 73 20 |. sp|ecifies |
|00002e60| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 6c 69 |the numb|er of li|
|00002e70| 6e 65 73 20 61 66 66 65 | 63 74 65 64 2e 20 20 2a |nes affe|cted. *|
|00002e80| 2f 0a 09 20 20 73 70 65 | 63 69 66 79 5f 73 74 79 |/.. spe|cify_sty|
|00002e90| 6c 65 20 28 4f 55 54 50 | 55 54 5f 52 43 53 29 3b |le (OUTP|UT_RCS);|
|00002ea0| 0a 09 20 20 62 72 65 61 | 6b 3b 0a 0a 09 63 61 73 |.. brea|k;...cas|
|00002eb0| 65 20 27 4e 27 3a 0a 09 | 20 20 2f 2a 20 57 68 65 |e 'N':..| /* Whe|
|00002ec0| 6e 20 63 6f 6d 70 61 72 | 69 6e 67 20 64 69 72 65 |n compar|ing dire|
|00002ed0| 63 74 6f 72 69 65 73 2c | 20 69 66 20 61 20 66 69 |ctories,| if a fi|
|00002ee0| 6c 65 20 61 70 70 65 61 | 72 73 20 6f 6e 6c 79 20 |le appea|rs only |
|00002ef0| 69 6e 20 6f 6e 65 0a 09 | 20 20 20 20 20 64 69 72 |in one..| dir|
|00002f00| 65 63 74 6f 72 79 2c 20 | 74 72 65 61 74 20 69 74 |ectory, |treat it|
|00002f10| 20 61 73 20 70 72 65 73 | 65 6e 74 20 62 75 74 20 | as pres|ent but |
|00002f20| 65 6d 70 74 79 20 69 6e | 20 74 68 65 20 6f 74 68 |empty in| the oth|
|00002f30| 65 72 2e 20 20 2a 2f 0a | 09 20 20 65 6e 74 69 72 |er. */.|. entir|
|00002f40| 65 5f 6e 65 77 5f 66 69 | 6c 65 5f 66 6c 61 67 20 |e_new_fi|le_flag |
|00002f50| 3d 20 31 3b 0a 09 20 20 | 62 72 65 61 6b 3b 0a 0a |= 1;.. |break;..|
|00002f60| 09 63 61 73 65 20 27 70 | 27 3a 0a 09 20 20 2f 2a |.case 'p|':.. /*|
|00002f70| 20 4d 61 6b 65 20 63 6f | 6e 74 65 78 74 2d 73 74 | Make co|ntext-st|
|00002f80| 79 6c 65 20 6f 75 74 70 | 75 74 20 61 6e 64 20 73 |yle outp|ut and s|
|00002f90| 68 6f 77 20 6e 61 6d 65 | 20 6f 66 20 6c 61 73 74 |how name| of last|
|00002fa0| 20 43 20 66 75 6e 63 74 | 69 6f 6e 2e 20 20 2a 2f | C funct|ion. */|
|00002fb0| 0a 09 20 20 73 68 6f 77 | 5f 63 5f 66 75 6e 63 74 |.. show|_c_funct|
|00002fc0| 69 6f 6e 20 3d 20 31 3b | 0a 09 20 20 61 64 64 5f |ion = 1;|.. add_|
|00002fd0| 72 65 67 65 78 70 20 28 | 26 66 75 6e 63 74 69 6f |regexp (|&functio|
|00002fe0| 6e 5f 72 65 67 65 78 70 | 5f 6c 69 73 74 2c 20 22 |n_regexp|_list, "|
|00002ff0| 5e 5b 5f 61 2d 7a 41 2d | 5a 24 5d 22 29 3b 0a 09 |^[_a-zA-|Z$]");..|
|00003000| 20 20 62 72 65 61 6b 3b | 0a 0a 09 63 61 73 65 20 | break;|...case |
|00003010| 27 50 27 3a 0a 09 20 20 | 2f 2a 20 57 68 65 6e 20 |'P':.. |/* When |
|00003020| 63 6f 6d 70 61 72 69 6e | 67 20 64 69 72 65 63 74 |comparin|g direct|
|00003030| 6f 72 69 65 73 2c 20 69 | 66 20 61 20 66 69 6c 65 |ories, i|f a file|
|00003040| 20 61 70 70 65 61 72 73 | 20 6f 6e 6c 79 20 69 6e | appears| only in|
|00003050| 0a 09 20 20 20 20 20 74 | 68 65 20 73 65 63 6f 6e |.. t|he secon|
|00003060| 64 20 64 69 72 65 63 74 | 6f 72 79 20 6f 66 20 74 |d direct|ory of t|
|00003070| 68 65 20 74 77 6f 2c 0a | 09 20 20 20 20 20 74 72 |he two,.|. tr|
|00003080| 65 61 74 20 69 74 20 61 | 73 20 70 72 65 73 65 6e |eat it a|s presen|
|00003090| 74 20 62 75 74 20 65 6d | 70 74 79 20 69 6e 20 74 |t but em|pty in t|
|000030a0| 68 65 20 6f 74 68 65 72 | 2e 20 20 2a 2f 0a 09 20 |he other|. */.. |
|000030b0| 20 75 6e 69 64 69 72 65 | 63 74 69 6f 6e 61 6c 5f | unidire|ctional_|
|000030c0| 6e 65 77 5f 66 69 6c 65 | 5f 66 6c 61 67 20 3d 20 |new_file|_flag = |
|000030d0| 31 3b 0a 09 20 20 62 72 | 65 61 6b 3b 0a 0a 09 63 |1;.. br|eak;...c|
|000030e0| 61 73 65 20 27 71 27 3a | 0a 09 20 20 6e 6f 5f 64 |ase 'q':|.. no_d|
|000030f0| 65 74 61 69 6c 73 5f 66 | 6c 61 67 20 3d 20 31 3b |etails_f|lag = 1;|
|00003100| 0a 09 20 20 62 72 65 61 | 6b 3b 0a 0a 09 63 61 73 |.. brea|k;...cas|
|00003110| 65 20 27 72 27 3a 0a 09 | 20 20 2f 2a 20 57 68 65 |e 'r':..| /* Whe|
|00003120| 6e 20 63 6f 6d 70 61 72 | 69 6e 67 20 64 69 72 65 |n compar|ing dire|
|00003130| 63 74 6f 72 69 65 73 2c | 0a 09 20 20 20 20 20 72 |ctories,|.. r|
|00003140| 65 63 75 72 73 69 76 65 | 6c 79 20 63 6f 6d 70 61 |ecursive|ly compa|
|00003150| 72 65 20 61 6e 79 20 73 | 75 62 64 69 72 65 63 74 |re any s|ubdirect|
|00003160| 6f 72 69 65 73 20 66 6f | 75 6e 64 2e 20 20 2a 2f |ories fo|und. */|
|00003170| 0a 09 20 20 72 65 63 75 | 72 73 69 76 65 20 3d 20 |.. recu|rsive = |
|00003180| 31 3b 0a 09 20 20 62 72 | 65 61 6b 3b 0a 0a 09 63 |1;.. br|eak;...c|
|00003190| 61 73 65 20 27 73 27 3a | 0a 09 20 20 2f 2a 20 50 |ase 's':|.. /* P|
|000031a0| 72 69 6e 74 20 61 20 6d | 65 73 73 61 67 65 20 69 |rint a m|essage i|
|000031b0| 66 20 74 68 65 20 66 69 | 6c 65 73 20 61 72 65 20 |f the fi|les are |
|000031c0| 74 68 65 20 73 61 6d 65 | 2e 20 20 2a 2f 0a 09 20 |the same|. */.. |
|000031d0| 20 70 72 69 6e 74 5f 66 | 69 6c 65 5f 73 61 6d 65 | print_f|ile_same|
|000031e0| 5f 66 6c 61 67 20 3d 20 | 31 3b 0a 09 20 20 62 72 |_flag = |1;.. br|
|000031f0| 65 61 6b 3b 0a 0a 09 63 | 61 73 65 20 27 53 27 3a |eak;...c|ase 'S':|
|00003200| 0a 09 20 20 2f 2a 20 57 | 68 65 6e 20 63 6f 6d 70 |.. /* W|hen comp|
|00003210| 61 72 69 6e 67 20 64 69 | 72 65 63 74 6f 72 69 65 |aring di|rectorie|
|00003220| 73 2c 20 73 74 61 72 74 | 20 77 69 74 68 20 74 68 |s, start| with th|
|00003230| 65 20 73 70 65 63 69 66 | 69 65 64 0a 09 20 20 20 |e specif|ied.. |
|00003240| 20 20 66 69 6c 65 20 6e | 61 6d 65 2e 20 20 54 68 | file n|ame. Th|
|00003250| 69 73 20 69 73 20 75 73 | 65 64 20 66 6f 72 20 72 |is is us|ed for r|
|00003260| 65 73 75 6d 69 6e 67 20 | 61 6e 20 61 62 6f 72 74 |esuming |an abort|
|00003270| 65 64 20 63 6f 6d 70 61 | 72 69 73 6f 6e 2e 20 20 |ed compa|rison. |
|00003280| 2a 2f 0a 09 20 20 64 69 | 72 5f 73 74 61 72 74 5f |*/.. di|r_start_|
|00003290| 66 69 6c 65 20 3d 20 6f | 70 74 61 72 67 3b 0a 09 |file = o|ptarg;..|
|000032a0| 20 20 62 72 65 61 6b 3b | 0a 0a 09 63 61 73 65 20 | break;|...case |
|000032b0| 27 74 27 3a 0a 09 20 20 | 2f 2a 20 45 78 70 61 6e |'t':.. |/* Expan|
|000032c0| 64 20 74 61 62 73 20 74 | 6f 20 73 70 61 63 65 73 |d tabs t|o spaces|
|000032d0| 20 69 6e 20 74 68 65 20 | 6f 75 74 70 75 74 20 73 | in the |output s|
|000032e0| 6f 20 74 68 61 74 20 69 | 74 20 70 72 65 73 65 72 |o that i|t preser|
|000032f0| 76 65 73 0a 09 20 20 20 | 20 20 74 68 65 20 61 6c |ves.. | the al|
|00003300| 69 67 6e 6d 65 6e 74 20 | 6f 66 20 74 68 65 20 69 |ignment |of the i|
|00003310| 6e 70 75 74 20 66 69 6c | 65 73 2e 20 20 2a 2f 0a |nput fil|es. */.|
|00003320| 09 20 20 74 61 62 5f 65 | 78 70 61 6e 64 5f 66 6c |. tab_e|xpand_fl|
|00003330| 61 67 20 3d 20 31 3b 0a | 09 20 20 62 72 65 61 6b |ag = 1;.|. break|
|00003340| 3b 0a 0a 09 63 61 73 65 | 20 27 54 27 3a 0a 09 20 |;...case| 'T':.. |
|00003350| 20 2f 2a 20 55 73 65 20 | 61 20 74 61 62 20 69 6e | /* Use |a tab in|
|00003360| 20 74 68 65 20 6f 75 74 | 70 75 74 2c 20 72 61 74 | the out|put, rat|
|00003370| 68 65 72 20 74 68 61 6e | 20 61 20 73 70 61 63 65 |her than| a space|
|00003380| 2c 20 62 65 66 6f 72 65 | 20 74 68 65 0a 09 20 20 |, before| the.. |
|00003390| 20 20 20 74 65 78 74 20 | 6f 66 20 61 6e 20 69 6e | text |of an in|
|000033a0| 70 75 74 20 6c 69 6e 65 | 2c 20 73 6f 20 61 73 20 |put line|, so as |
|000033b0| 74 6f 20 6b 65 65 70 20 | 74 68 65 20 70 72 6f 70 |to keep |the prop|
|000033c0| 65 72 20 61 6c 69 67 6e | 6d 65 6e 74 0a 09 20 20 |er align|ment.. |
|000033d0| 20 20 20 69 6e 20 74 68 | 65 20 69 6e 70 75 74 20 | in th|e input |
|000033e0| 6c 69 6e 65 20 77 69 74 | 68 6f 75 74 20 63 68 61 |line wit|hout cha|
|000033f0| 6e 67 69 6e 67 20 74 68 | 65 20 63 68 61 72 61 63 |nging th|e charac|
|00003400| 74 65 72 73 20 69 6e 20 | 69 74 2e 20 20 2a 2f 0a |ters in |it. */.|
|00003410| 09 20 20 74 61 62 5f 61 | 6c 69 67 6e 5f 66 6c 61 |. tab_a|lign_fla|
|00003420| 67 20 3d 20 31 3b 0a 09 | 20 20 62 72 65 61 6b 3b |g = 1;..| break;|
|00003430| 0a 0a 09 63 61 73 65 20 | 27 75 27 3a 0a 09 20 20 |...case |'u':.. |
|00003440| 2f 2a 20 4f 75 74 70 75 | 74 20 74 68 65 20 63 6f |/* Outpu|t the co|
|00003450| 6e 74 65 78 74 20 64 69 | 66 66 20 69 6e 20 75 6e |ntext di|ff in un|
|00003460| 69 64 69 66 66 20 66 6f | 72 6d 61 74 2e 20 20 2a |idiff fo|rmat. *|
|00003470| 2f 0a 09 20 20 73 70 65 | 63 69 66 79 5f 73 74 79 |/.. spe|cify_sty|
|00003480| 6c 65 20 28 4f 55 54 50 | 55 54 5f 55 4e 49 46 49 |le (OUTP|UT_UNIFI|
|00003490| 45 44 29 3b 0a 09 20 20 | 62 72 65 61 6b 3b 0a 0a |ED);.. |break;..|
|000034a0| 09 63 61 73 65 20 27 76 | 27 3a 0a 09 20 20 70 72 |.case 'v|':.. pr|
|000034b0| 69 6e 74 66 20 28 22 64 | 69 66 66 20 2d 20 47 4e |intf ("d|iff - GN|
|000034c0| 55 20 64 69 66 66 75 74 | 69 6c 73 20 76 65 72 73 |U diffut|ils vers|
|000034d0| 69 6f 6e 20 25 73 5c 6e | 22 2c 20 76 65 72 73 69 |ion %s\n|", versi|
|000034e0| 6f 6e 5f 73 74 72 69 6e | 67 29 3b 0a 09 20 20 65 |on_strin|g);.. e|
|000034f0| 78 69 74 20 28 30 29 3b | 0a 0a 09 63 61 73 65 20 |xit (0);|...case |
|00003500| 27 77 27 3a 0a 09 20 20 | 2f 2a 20 49 67 6e 6f 72 |'w':.. |/* Ignor|
|00003510| 65 20 68 6f 72 69 7a 6f | 6e 74 61 6c 20 77 68 69 |e horizo|ntal whi|
|00003520| 74 65 20 73 70 61 63 65 | 20 77 68 65 6e 20 63 6f |te space| when co|
|00003530| 6d 70 61 72 69 6e 67 20 | 6c 69 6e 65 73 2e 20 20 |mparing |lines. |
|00003540| 2a 2f 0a 09 20 20 69 67 | 6e 6f 72 65 5f 61 6c 6c |*/.. ig|nore_all|
|00003550| 5f 73 70 61 63 65 5f 66 | 6c 61 67 20 3d 20 31 3b |_space_f|lag = 1;|
|00003560| 0a 09 20 20 69 67 6e 6f | 72 65 5f 73 6f 6d 65 5f |.. igno|re_some_|
|00003570| 63 68 61 6e 67 65 73 20 | 3d 20 31 3b 0a 09 20 20 |changes |= 1;.. |
|00003580| 69 67 6e 6f 72 65 5f 73 | 6f 6d 65 5f 6c 69 6e 65 |ignore_s|ome_line|
|00003590| 5f 63 68 61 6e 67 65 73 | 20 3d 20 31 3b 0a 09 20 |_changes| = 1;.. |
|000035a0| 20 62 72 65 61 6b 3b 0a | 0a 09 63 61 73 65 20 27 | break;.|..case '|
|000035b0| 78 27 3a 0a 09 20 20 61 | 64 64 5f 65 78 63 6c 75 |x':.. a|dd_exclu|
|000035c0| 64 65 20 28 6f 70 74 61 | 72 67 29 3b 0a 09 20 20 |de (opta|rg);.. |
|000035d0| 62 72 65 61 6b 3b 0a 0a | 09 63 61 73 65 20 27 58 |break;..|.case 'X|
|000035e0| 27 3a 0a 09 20 20 69 66 | 20 28 61 64 64 5f 65 78 |':.. if| (add_ex|
|000035f0| 63 6c 75 64 65 5f 66 69 | 6c 65 20 28 6f 70 74 61 |clude_fi|le (opta|
|00003600| 72 67 29 20 21 3d 20 30 | 29 0a 09 20 20 20 20 70 |rg) != 0|).. p|
|00003610| 66 61 74 61 6c 5f 77 69 | 74 68 5f 6e 61 6d 65 20 |fatal_wi|th_name |
|00003620| 28 6f 70 74 61 72 67 29 | 3b 0a 09 20 20 62 72 65 |(optarg)|;.. bre|
|00003630| 61 6b 3b 0a 0a 09 63 61 | 73 65 20 27 79 27 3a 0a |ak;...ca|se 'y':.|
|00003640| 09 20 20 2f 2a 20 55 73 | 65 20 73 69 64 65 2d 62 |. /* Us|e side-b|
|00003650| 79 2d 73 69 64 65 20 28 | 73 64 69 66 66 2d 73 74 |y-side (|sdiff-st|
|00003660| 79 6c 65 29 20 63 6f 6c | 75 6d 6e 61 72 20 6f 75 |yle) col|umnar ou|
|00003670| 74 70 75 74 2e 20 2a 2f | 0a 09 20 20 73 70 65 63 |tput. */|.. spec|
|00003680| 69 66 79 5f 73 74 79 6c | 65 20 28 4f 55 54 50 55 |ify_styl|e (OUTPU|
|00003690| 54 5f 53 44 49 46 46 29 | 3b 0a 09 20 20 62 72 65 |T_SDIFF)|;.. bre|
|000036a0| 61 6b 3b 0a 0a 09 63 61 | 73 65 20 27 57 27 3a 0a |ak;...ca|se 'W':.|
|000036b0| 09 20 20 2f 2a 20 53 65 | 74 20 74 68 65 20 6c 69 |. /* Se|t the li|
|000036c0| 6e 65 20 77 69 64 74 68 | 20 66 6f 72 20 4f 55 54 |ne width| for OUT|
|000036d0| 50 55 54 5f 53 44 49 46 | 46 2e 20 20 2a 2f 0a 09 |PUT_SDIF|F. */..|
|000036e0| 20 20 69 66 20 28 63 6b | 5f 61 74 6f 69 20 28 6f | if (ck|_atoi (o|
|000036f0| 70 74 61 72 67 2c 20 26 | 77 69 64 74 68 29 20 7c |ptarg, &|width) ||
|00003700| 7c 20 77 69 64 74 68 20 | 3c 3d 20 30 29 0a 09 20 || width |<= 0).. |
|00003710| 20 20 20 66 61 74 61 6c | 20 28 22 63 6f 6c 75 6d | fatal| ("colum|
|00003720| 6e 20 77 69 64 74 68 20 | 6d 75 73 74 20 62 65 20 |n width |must be |
|00003730| 61 20 70 6f 73 69 74 69 | 76 65 20 69 6e 74 65 67 |a positi|ve integ|
|00003740| 65 72 22 29 3b 0a 09 20 | 20 62 72 65 61 6b 3b 0a |er");.. | break;.|
|00003750| 0a 09 63 61 73 65 20 31 | 32 39 3a 0a 09 20 20 73 |..case 1|29:.. s|
|00003760| 64 69 66 66 5f 6c 65 66 | 74 5f 6f 6e 6c 79 20 3d |diff_lef|t_only =|
|00003770| 20 31 3b 0a 09 20 20 62 | 72 65 61 6b 3b 0a 0a 09 | 1;.. b|reak;...|
|00003780| 63 61 73 65 20 31 33 30 | 3a 0a 09 20 20 73 64 69 |case 130|:.. sdi|
|00003790| 66 66 5f 73 6b 69 70 5f | 63 6f 6d 6d 6f 6e 5f 6c |ff_skip_|common_l|
|000037a0| 69 6e 65 73 20 3d 20 31 | 3b 0a 09 20 20 62 72 65 |ines = 1|;.. bre|
|000037b0| 61 6b 3b 0a 0a 09 63 61 | 73 65 20 31 33 31 3a 0a |ak;...ca|se 131:.|
|000037c0| 09 20 20 2f 2a 20 73 64 | 69 66 66 2d 73 74 79 6c |. /* sd|iff-styl|
|000037d0| 65 20 63 6f 6c 75 6d 6e | 73 20 6f 75 74 70 75 74 |e column|s output|
|000037e0| 2e 20 2a 2f 0a 09 20 20 | 73 70 65 63 69 66 79 5f |. */.. |specify_|
|000037f0| 73 74 79 6c 65 20 28 4f | 55 54 50 55 54 5f 53 44 |style (O|UTPUT_SD|
|00003800| 49 46 46 29 3b 0a 09 20 | 20 73 64 69 66 66 5f 68 |IFF);.. | sdiff_h|
|00003810| 65 6c 70 5f 73 64 69 66 | 66 20 3d 20 31 3b 0a 09 |elp_sdif|f = 1;..|
|00003820| 20 20 62 72 65 61 6b 3b | 0a 0a 09 63 61 73 65 20 | break;|...case |
|00003830| 31 33 32 3a 0a 09 63 61 | 73 65 20 31 33 33 3a 0a |132:..ca|se 133:.|
|00003840| 09 63 61 73 65 20 31 33 | 34 3a 0a 09 20 20 73 70 |.case 13|4:.. sp|
|00003850| 65 63 69 66 79 5f 73 74 | 79 6c 65 20 28 4f 55 54 |ecify_st|yle (OUT|
|00003860| 50 55 54 5f 49 46 44 45 | 46 29 3b 0a 09 20 20 69 |PUT_IFDE|F);.. i|
|00003870| 66 20 28 73 70 65 63 69 | 66 79 5f 66 6f 72 6d 61 |f (speci|fy_forma|
|00003880| 74 20 28 26 6c 69 6e 65 | 5f 66 6f 72 6d 61 74 5b |t (&line|_format[|
|00003890| 63 20 2d 20 31 33 32 5d | 2c 20 6f 70 74 61 72 67 |c - 132]|, optarg|
|000038a0| 29 20 21 3d 20 30 29 0a | 09 20 20 20 20 65 72 72 |) != 0).|. err|
|000038b0| 6f 72 20 28 22 63 6f 6e | 66 6c 69 63 74 69 6e 67 |or ("con|flicting|
|000038c0| 20 6c 69 6e 65 20 66 6f | 72 6d 61 74 22 2c 20 30 | line fo|rmat", 0|
|000038d0| 2c 20 30 29 3b 0a 09 20 | 20 62 72 65 61 6b 3b 0a |, 0);.. | break;.|
|000038e0| 0a 09 63 61 73 65 20 31 | 33 35 3a 0a 09 20 20 73 |..case 1|35:.. s|
|000038f0| 70 65 63 69 66 79 5f 73 | 74 79 6c 65 20 28 4f 55 |pecify_s|tyle (OU|
|00003900| 54 50 55 54 5f 49 46 44 | 45 46 29 3b 0a 09 20 20 |TPUT_IFD|EF);.. |
|00003910| 7b 0a 09 20 20 20 20 69 | 6e 74 20 69 2c 20 65 72 |{.. i|nt i, er|
|00003920| 72 20 3d 20 30 3b 0a 09 | 20 20 20 20 66 6f 72 20 |r = 0;..| for |
|00003930| 28 69 20 3d 20 30 3b 20 | 69 20 3c 20 73 69 7a 65 |(i = 0; |i < size|
|00003940| 6f 66 20 28 6c 69 6e 65 | 5f 66 6f 72 6d 61 74 29 |of (line|_format)|
|00003950| 20 2f 20 73 69 7a 65 6f | 66 20 28 2a 6c 69 6e 65 | / sizeo|f (*line|
|00003960| 5f 66 6f 72 6d 61 74 29 | 3b 20 69 2b 2b 29 0a 09 |_format)|; i++)..|
|00003970| 20 20 20 20 20 20 65 72 | 72 20 7c 3d 20 73 70 65 | er|r |= spe|
|00003980| 63 69 66 79 5f 66 6f 72 | 6d 61 74 20 28 26 6c 69 |cify_for|mat (&li|
|00003990| 6e 65 5f 66 6f 72 6d 61 | 74 5b 69 5d 2c 20 6f 70 |ne_forma|t[i], op|
|000039a0| 74 61 72 67 29 3b 0a 09 | 20 20 20 20 69 66 20 28 |targ);..| if (|
|000039b0| 65 72 72 29 0a 09 20 20 | 20 20 20 20 65 72 72 6f |err).. | erro|
|000039c0| 72 20 28 22 63 6f 6e 66 | 6c 69 63 74 69 6e 67 20 |r ("conf|licting |
|000039d0| 6c 69 6e 65 20 66 6f 72 | 6d 61 74 22 2c 20 30 2c |line for|mat", 0,|
|000039e0| 20 30 29 3b 0a 09 20 20 | 7d 0a 09 20 20 62 72 65 | 0);.. |}.. bre|
|000039f0| 61 6b 3b 0a 0a 09 63 61 | 73 65 20 31 33 36 3a 0a |ak;...ca|se 136:.|
|00003a00| 09 63 61 73 65 20 31 33 | 37 3a 0a 09 63 61 73 65 |.case 13|7:..case|
|00003a10| 20 31 33 38 3a 0a 09 63 | 61 73 65 20 31 33 39 3a | 138:..c|ase 139:|
|00003a20| 0a 09 20 20 73 70 65 63 | 69 66 79 5f 73 74 79 6c |.. spec|ify_styl|
|00003a30| 65 20 28 4f 55 54 50 55 | 54 5f 49 46 44 45 46 29 |e (OUTPU|T_IFDEF)|
|00003a40| 3b 0a 09 20 20 69 66 20 | 28 73 70 65 63 69 66 79 |;.. if |(specify|
|00003a50| 5f 66 6f 72 6d 61 74 20 | 28 26 67 72 6f 75 70 5f |_format |(&group_|
|00003a60| 66 6f 72 6d 61 74 5b 63 | 20 2d 20 31 33 36 5d 2c |format[c| - 136],|
|00003a70| 20 6f 70 74 61 72 67 29 | 20 21 3d 20 30 29 0a 09 | optarg)| != 0)..|
|00003a80| 20 20 20 20 65 72 72 6f | 72 20 28 22 63 6f 6e 66 | erro|r ("conf|
|00003a90| 6c 69 63 74 69 6e 67 20 | 67 72 6f 75 70 20 66 6f |licting |group fo|
|00003aa0| 72 6d 61 74 22 2c 20 30 | 2c 20 30 29 3b 0a 09 20 |rmat", 0|, 0);.. |
|00003ab0| 20 62 72 65 61 6b 3b 0a | 0a 09 63 61 73 65 20 31 | break;.|..case 1|
|00003ac0| 34 30 3a 0a 09 20 20 69 | 66 20 28 63 6b 5f 61 74 |40:.. i|f (ck_at|
|00003ad0| 6f 69 20 28 6f 70 74 61 | 72 67 2c 20 26 68 6f 72 |oi (opta|rg, &hor|
|00003ae0| 69 7a 6f 6e 5f 6c 69 6e | 65 73 29 20 7c 7c 20 68 |izon_lin|es) || h|
|00003af0| 6f 72 69 7a 6f 6e 5f 6c | 69 6e 65 73 20 3c 20 30 |orizon_l|ines < 0|
|00003b00| 29 0a 09 20 20 20 20 66 | 61 74 61 6c 20 28 22 68 |).. f|atal ("h|
|00003b10| 6f 72 69 7a 6f 6e 20 6d | 75 73 74 20 62 65 20 61 |orizon m|ust be a|
|00003b20| 20 6e 6f 6e 6e 65 67 61 | 74 69 76 65 20 69 6e 74 | nonnega|tive int|
|00003b30| 65 67 65 72 22 29 3b 0a | 09 20 20 62 72 65 61 6b |eger");.|. break|
|00003b40| 3b 0a 0a 09 63 61 73 65 | 20 31 34 31 3a 0a 09 20 |;...case| 141:.. |
|00003b50| 20 75 73 61 67 65 20 28 | 29 3b 0a 09 20 20 63 68 | usage (|);.. ch|
|00003b60| 65 63 6b 5f 73 74 64 6f | 75 74 20 28 29 3b 0a 09 |eck_stdo|ut ();..|
|00003b70| 20 20 65 78 69 74 20 28 | 30 29 3b 0a 0a 09 63 61 | exit (|0);...ca|
|00003b80| 73 65 20 31 34 32 3a 0a | 09 20 20 2f 2a 20 55 73 |se 142:.|. /* Us|
|00003b90| 65 20 62 69 6e 61 72 79 | 20 49 2f 4f 20 77 68 65 |e binary| I/O whe|
|00003ba0| 6e 20 72 65 61 64 69 6e | 67 20 61 6e 64 20 77 72 |n readin|g and wr|
|00003bb0| 69 74 69 6e 67 20 64 61 | 74 61 2e 0a 09 20 20 20 |iting da|ta... |
|00003bc0| 20 20 4f 6e 20 50 6f 73 | 69 78 20 68 6f 73 74 73 | On Pos|ix hosts|
|00003bd0| 2c 20 74 68 69 73 20 68 | 61 73 20 6e 6f 20 65 66 |, this h|as no ef|
|00003be0| 66 65 63 74 2e 20 20 2a | 2f 0a 23 69 66 20 48 41 |fect. *|/.#if HA|
|00003bf0| 56 45 5f 53 45 54 4d 4f | 44 45 0a 09 20 20 62 69 |VE_SETMO|DE.. bi|
|00003c00| 6e 61 72 79 5f 49 5f 4f | 20 3d 20 31 3b 0a 09 20 |nary_I_O| = 1;.. |
|00003c10| 20 73 65 74 6d 6f 64 65 | 20 28 53 54 44 4f 55 54 | setmode| (STDOUT|
|00003c20| 5f 46 49 4c 45 4e 4f 2c | 20 4f 5f 42 49 4e 41 52 |_FILENO,| O_BINAR|
|00003c30| 59 29 3b 0a 23 65 6e 64 | 69 66 0a 09 20 20 62 72 |Y);.#end|if.. br|
|00003c40| 65 61 6b 3b 0a 0a 09 64 | 65 66 61 75 6c 74 3a 0a |eak;...d|efault:.|
|00003c50| 09 20 20 74 72 79 5f 68 | 65 6c 70 20 28 30 29 3b |. try_h|elp (0);|
|00003c60| 0a 09 7d 0a 20 20 20 20 | 20 20 70 72 65 76 20 3d |..}. | prev =|
|00003c70| 20 63 3b 0a 20 20 20 20 | 7d 0a 0a 20 20 69 66 20 | c;. |}.. if |
|00003c80| 28 61 72 67 63 20 2d 20 | 6f 70 74 69 6e 64 20 21 |(argc - |optind !|
|00003c90| 3d 20 32 29 0a 20 20 20 | 20 74 72 79 5f 68 65 6c |= 2). | try_hel|
|00003ca0| 70 20 28 61 72 67 63 20 | 2d 20 6f 70 74 69 6e 64 |p (argc |- optind|
|00003cb0| 20 3c 20 32 20 3f 20 22 | 6d 69 73 73 69 6e 67 20 | < 2 ? "|missing |
|00003cc0| 6f 70 65 72 61 6e 64 22 | 20 3a 20 22 65 78 74 72 |operand"| : "extr|
|00003cd0| 61 20 6f 70 65 72 61 6e | 64 22 29 3b 0a 0a 0a 20 |a operan|d");... |
|00003ce0| 20 7b 0a 20 20 20 20 2f | 2a 0a 20 20 20 20 20 2a | {. /|*. *|
|00003cf0| 09 57 65 20 6d 61 78 69 | 6d 69 7a 65 20 66 69 72 |.We maxi|mize fir|
|00003d00| 73 74 20 74 68 65 20 68 | 61 6c 66 20 6c 69 6e 65 |st the h|alf line|
|00003d10| 20 77 69 64 74 68 2c 20 | 61 6e 64 20 74 68 65 6e | width, |and then|
|00003d20| 20 74 68 65 20 67 75 74 | 74 65 72 20 77 69 64 74 | the gut|ter widt|
|00003d30| 68 2c 0a 20 20 20 20 20 | 2a 09 61 63 63 6f 72 64 |h,. |*.accord|
|00003d40| 69 6e 67 20 74 6f 20 74 | 68 65 20 66 6f 6c 6c 6f |ing to t|he follo|
|00003d50| 77 69 6e 67 20 63 6f 6e | 73 74 72 61 69 6e 74 73 |wing con|straints|
|00003d60| 3a 0a 20 20 20 20 20 2a | 09 31 2e 20 20 54 77 6f |:. *|.1. Two|
|00003d70| 20 68 61 6c 66 20 6c 69 | 6e 65 73 20 70 6c 75 73 | half li|nes plus|
|00003d80| 20 61 20 67 75 74 74 65 | 72 20 6d 75 73 74 20 66 | a gutte|r must f|
|00003d90| 69 74 20 69 6e 20 61 20 | 6c 69 6e 65 2e 0a 20 20 |it in a |line.. |
|00003da0| 20 20 20 2a 09 32 2e 20 | 20 49 66 20 74 68 65 20 | *.2. | If the |
|00003db0| 68 61 6c 66 20 6c 69 6e | 65 20 77 69 64 74 68 20 |half lin|e width |
|00003dc0| 69 73 20 6e 6f 6e 7a 65 | 72 6f 3a 0a 20 20 20 20 |is nonze|ro:. |
|00003dd0| 20 2a 09 20 20 20 20 61 | 2e 20 20 54 68 65 20 67 | *. a|. The g|
|00003de0| 75 74 74 65 72 20 77 69 | 64 74 68 20 69 73 20 61 |utter wi|dth is a|
|00003df0| 74 20 6c 65 61 73 74 20 | 47 55 54 54 45 52 5f 57 |t least |GUTTER_W|
|00003e00| 49 44 54 48 5f 4d 49 4e | 49 4d 55 4d 2e 0a 20 20 |IDTH_MIN|IMUM.. |
|00003e10| 20 20 20 2a 09 20 20 20 | 20 62 2e 20 20 49 66 20 | *. | b. If |
|00003e20| 74 61 62 73 20 61 72 65 | 20 6e 6f 74 20 65 78 70 |tabs are| not exp|
|00003e30| 61 6e 64 65 64 20 74 6f | 20 73 70 61 63 65 73 2c |anded to| spaces,|
|00003e40| 0a 20 20 20 20 20 2a 09 | 09 61 20 68 61 6c 66 20 |. *.|.a half |
|00003e50| 6c 69 6e 65 20 70 6c 75 | 73 20 61 20 67 75 74 74 |line plu|s a gutt|
|00003e60| 65 72 20 69 73 20 61 6e | 20 69 6e 74 65 67 72 61 |er is an| integra|
|00003e70| 6c 20 6e 75 6d 62 65 72 | 20 6f 66 20 74 61 62 73 |l number| of tabs|
|00003e80| 2c 0a 20 20 20 20 20 2a | 09 09 73 6f 20 74 68 61 |,. *|..so tha|
|00003e90| 74 20 74 61 62 73 20 69 | 6e 20 74 68 65 20 72 69 |t tabs i|n the ri|
|00003ea0| 67 68 74 20 63 6f 6c 75 | 6d 6e 20 6c 69 6e 65 20 |ght colu|mn line |
|00003eb0| 75 70 2e 0a 20 20 20 20 | 20 2a 2f 0a 20 20 20 20 |up.. | */. |
|00003ec0| 69 6e 74 20 74 20 3d 20 | 74 61 62 5f 65 78 70 61 |int t = |tab_expa|
|00003ed0| 6e 64 5f 66 6c 61 67 20 | 3f 20 31 20 3a 20 54 41 |nd_flag |? 1 : TA|
|00003ee0| 42 5f 57 49 44 54 48 3b | 0a 20 20 20 20 69 6e 74 |B_WIDTH;|. int|
|00003ef0| 20 6f 66 66 20 3d 20 28 | 77 69 64 74 68 20 2b 20 | off = (|width + |
|00003f00| 74 20 2b 20 47 55 54 54 | 45 52 5f 57 49 44 54 48 |t + GUTT|ER_WIDTH|
|00003f10| 5f 4d 49 4e 49 4d 55 4d | 29 20 2f 20 28 32 2a 74 |_MINIMUM|) / (2*t|
|00003f20| 29 20 20 2a 20 20 74 3b | 0a 20 20 20 20 73 64 69 |) * t;|. sdi|
|00003f30| 66 66 5f 68 61 6c 66 5f | 77 69 64 74 68 20 3d 20 |ff_half_|width = |
|00003f40| 6d 61 78 20 28 30 2c 20 | 6d 69 6e 20 28 6f 66 66 |max (0, |min (off|
|00003f50| 20 2d 20 47 55 54 54 45 | 52 5f 57 49 44 54 48 5f | - GUTTE|R_WIDTH_|
|00003f60| 4d 49 4e 49 4d 55 4d 2c | 20 77 69 64 74 68 20 2d |MINIMUM,| width -|
|00003f70| 20 6f 66 66 29 29 2c 0a | 20 20 20 20 73 64 69 66 | off)),.| sdif|
|00003f80| 66 5f 63 6f 6c 75 6d 6e | 32 5f 6f 66 66 73 65 74 |f_column|2_offset|
|00003f90| 20 3d 20 73 64 69 66 66 | 5f 68 61 6c 66 5f 77 69 | = sdiff|_half_wi|
|00003fa0| 64 74 68 20 3f 20 6f 66 | 66 20 3a 20 77 69 64 74 |dth ? of|f : widt|
|00003fb0| 68 3b 0a 20 20 7d 0a 0a | 20 20 69 66 20 28 73 68 |h;. }..| if (sh|
|00003fc0| 6f 77 5f 63 5f 66 75 6e | 63 74 69 6f 6e 20 26 26 |ow_c_fun|ction &&|
|00003fd0| 20 6f 75 74 70 75 74 5f | 73 74 79 6c 65 20 21 3d | output_|style !=|
|00003fe0| 20 4f 55 54 50 55 54 5f | 55 4e 49 46 49 45 44 29 | OUTPUT_|UNIFIED)|
|00003ff0| 0a 20 20 20 20 73 70 65 | 63 69 66 79 5f 73 74 79 |. spe|cify_sty|
|00004000| 6c 65 20 28 4f 55 54 50 | 55 54 5f 43 4f 4e 54 45 |le (OUTP|UT_CONTE|
|00004010| 58 54 29 3b 0a 0a 20 20 | 69 66 20 28 6f 75 74 70 |XT);.. |if (outp|
|00004020| 75 74 5f 73 74 79 6c 65 | 20 21 3d 20 4f 55 54 50 |ut_style| != OUTP|
|00004030| 55 54 5f 43 4f 4e 54 45 | 58 54 20 26 26 20 6f 75 |UT_CONTE|XT && ou|
|00004040| 74 70 75 74 5f 73 74 79 | 6c 65 20 21 3d 20 4f 55 |tput_sty|le != OU|
|00004050| 54 50 55 54 5f 55 4e 49 | 46 49 45 44 29 0a 20 20 |TPUT_UNI|FIED). |
|00004060| 20 20 63 6f 6e 74 65 78 | 74 20 3d 20 30 3b 0a 20 | contex|t = 0;. |
|00004070| 20 65 6c 73 65 20 69 66 | 20 28 63 6f 6e 74 65 78 | else if| (contex|
|00004080| 74 20 3d 3d 20 2d 31 29 | 0a 20 20 20 20 2f 2a 20 |t == -1)|. /* |
|00004090| 44 65 66 61 75 6c 74 20 | 61 6d 6f 75 6e 74 20 6f |Default |amount o|
|000040a0| 66 20 63 6f 6e 74 65 78 | 74 20 66 6f 72 20 2d 63 |f contex|t for -c|
|000040b0| 2e 20 20 2a 2f 0a 20 20 | 20 20 63 6f 6e 74 65 78 |. */. | contex|
|000040c0| 74 20 3d 20 33 3b 0a 0a | 20 20 69 66 20 28 6f 75 |t = 3;..| if (ou|
|000040d0| 74 70 75 74 5f 73 74 79 | 6c 65 20 3d 3d 20 4f 55 |tput_sty|le == OU|
|000040e0| 54 50 55 54 5f 49 46 44 | 45 46 29 0a 20 20 20 20 |TPUT_IFD|EF). |
|000040f0| 7b 0a 20 20 20 20 20 20 | 2f 2a 20 46 6f 72 6d 61 |{. |/* Forma|
|00004100| 74 20 61 72 72 61 79 73 | 20 61 72 65 20 63 68 61 |t arrays| are cha|
|00004110| 72 20 2a 2c 20 6e 6f 74 | 20 63 68 61 72 20 63 6f |r *, not| char co|
|00004120| 6e 73 74 20 2a 2c 0a 09 | 20 62 65 63 61 75 73 65 |nst *,..| because|
|00004130| 20 69 6e 74 65 67 65 72 | 20 66 6f 72 6d 61 74 73 | integer| formats|
|00004140| 20 61 72 65 20 74 65 6d | 70 6f 72 61 72 69 6c 79 | are tem|porarily|
|00004150| 20 6d 6f 64 69 66 69 65 | 64 2e 0a 09 20 42 75 74 | modifie|d... But|
|00004160| 20 69 74 20 69 73 20 73 | 61 66 65 20 74 6f 20 61 | it is s|afe to a|
|00004170| 73 73 69 67 6e 20 61 20 | 63 6f 6e 73 74 61 6e 74 |ssign a |constant|
|00004180| 20 6c 69 6b 65 20 22 25 | 3d 22 20 74 6f 20 61 20 | like "%|=" to a |
|00004190| 66 6f 72 6d 61 74 20 61 | 72 72 61 79 2c 0a 09 20 |format a|rray,.. |
|000041a0| 73 69 6e 63 65 20 22 25 | 3d 22 20 64 6f 65 73 20 |since "%|=" does |
|000041b0| 6e 6f 74 20 66 6f 72 6d | 61 74 20 61 6e 79 20 69 |not form|at any i|
|000041c0| 6e 74 65 67 65 72 73 2e | 20 20 2a 2f 0a 20 20 20 |ntegers.| */. |
|000041d0| 20 20 20 69 6e 74 20 69 | 3b 0a 20 20 20 20 20 20 | int i|;. |
|000041e0| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 69 20 3c 20 |for (i =| 0; i < |
|000041f0| 73 69 7a 65 6f 66 20 28 | 6c 69 6e 65 5f 66 6f 72 |sizeof (|line_for|
|00004200| 6d 61 74 29 20 2f 20 73 | 69 7a 65 6f 66 20 28 2a |mat) / s|izeof (*|
|00004210| 6c 69 6e 65 5f 66 6f 72 | 6d 61 74 29 3b 20 69 2b |line_for|mat); i+|
|00004220| 2b 29 0a 09 69 66 20 28 | 21 6c 69 6e 65 5f 66 6f |+)..if (|!line_fo|
|00004230| 72 6d 61 74 5b 69 5d 29 | 0a 09 20 20 6c 69 6e 65 |rmat[i])|.. line|
|00004240| 5f 66 6f 72 6d 61 74 5b | 69 5d 20 3d 20 22 25 6c |_format[|i] = "%l|
|00004250| 5c 6e 22 3b 0a 20 20 20 | 20 20 20 69 66 20 28 21 |\n";. | if (!|
|00004260| 67 72 6f 75 70 5f 66 6f | 72 6d 61 74 5b 4f 4c 44 |group_fo|rmat[OLD|
|00004270| 5d 29 0a 09 67 72 6f 75 | 70 5f 66 6f 72 6d 61 74 |])..grou|p_format|
|00004280| 5b 4f 4c 44 5d 0a 09 20 | 20 3d 20 67 72 6f 75 70 |[OLD].. | = group|
|00004290| 5f 66 6f 72 6d 61 74 5b | 55 4e 43 48 41 4e 47 45 |_format[|UNCHANGE|
|000042a0| 44 5d 20 3f 20 67 72 6f | 75 70 5f 66 6f 72 6d 61 |D] ? gro|up_forma|
|000042b0| 74 5b 55 4e 43 48 41 4e | 47 45 44 5d 20 3a 20 22 |t[UNCHAN|GED] : "|
|000042c0| 25 3c 22 3b 0a 20 20 20 | 20 20 20 69 66 20 28 21 |%<";. | if (!|
|000042d0| 67 72 6f 75 70 5f 66 6f | 72 6d 61 74 5b 4e 45 57 |group_fo|rmat[NEW|
|000042e0| 5d 29 0a 09 67 72 6f 75 | 70 5f 66 6f 72 6d 61 74 |])..grou|p_format|
|000042f0| 5b 4e 45 57 5d 0a 09 20 | 20 3d 20 67 72 6f 75 70 |[NEW].. | = group|
|00004300| 5f 66 6f 72 6d 61 74 5b | 55 4e 43 48 41 4e 47 45 |_format[|UNCHANGE|
|00004310| 44 5d 20 3f 20 67 72 6f | 75 70 5f 66 6f 72 6d 61 |D] ? gro|up_forma|
|00004320| 74 5b 55 4e 43 48 41 4e | 47 45 44 5d 20 3a 20 22 |t[UNCHAN|GED] : "|
|00004330| 25 3e 22 3b 0a 20 20 20 | 20 20 20 69 66 20 28 21 |%>";. | if (!|
|00004340| 67 72 6f 75 70 5f 66 6f | 72 6d 61 74 5b 55 4e 43 |group_fo|rmat[UNC|
|00004350| 48 41 4e 47 45 44 5d 29 | 0a 09 67 72 6f 75 70 5f |HANGED])|..group_|
|00004360| 66 6f 72 6d 61 74 5b 55 | 4e 43 48 41 4e 47 45 44 |format[U|NCHANGED|
|00004370| 5d 20 3d 20 22 25 3d 22 | 3b 0a 20 20 20 20 20 20 |] = "%="|;. |
|00004380| 69 66 20 28 21 67 72 6f | 75 70 5f 66 6f 72 6d 61 |if (!gro|up_forma|
|00004390| 74 5b 43 48 41 4e 47 45 | 44 5d 29 0a 09 67 72 6f |t[CHANGE|D])..gro|
|000043a0| 75 70 5f 66 6f 72 6d 61 | 74 5b 43 48 41 4e 47 45 |up_forma|t[CHANGE|
|000043b0| 44 5d 20 3d 20 63 6f 6e | 63 61 74 20 28 67 72 6f |D] = con|cat (gro|
|000043c0| 75 70 5f 66 6f 72 6d 61 | 74 5b 4f 4c 44 5d 2c 0a |up_forma|t[OLD],.|
|000043d0| 09 09 09 09 09 67 72 6f | 75 70 5f 66 6f 72 6d 61 |.....gro|up_forma|
|000043e0| 74 5b 4e 45 57 5d 2c 20 | 22 22 29 3b 0a 20 20 20 |t[NEW], |"");. |
|000043f0| 20 7d 0a 0a 20 20 6e 6f | 5f 64 69 66 66 5f 6d 65 | }.. no|_diff_me|
|00004400| 61 6e 73 5f 6e 6f 5f 6f | 75 74 70 75 74 20 3d 0a |ans_no_o|utput =.|
|00004410| 20 20 20 20 28 6f 75 74 | 70 75 74 5f 73 74 79 6c | (out|put_styl|
|00004420| 65 20 3d 3d 20 4f 55 54 | 50 55 54 5f 49 46 44 45 |e == OUT|PUT_IFDE|
|00004430| 46 20 3f 0a 20 20 20 20 | 20 20 28 21 2a 67 72 6f |F ?. | (!*gro|
|00004440| 75 70 5f 66 6f 72 6d 61 | 74 5b 55 4e 43 48 41 4e |up_forma|t[UNCHAN|
|00004450| 47 45 44 5d 0a 20 20 20 | 20 20 20 20 7c 7c 20 28 |GED]. | || (|
|00004460| 73 74 72 63 6d 70 20 28 | 67 72 6f 75 70 5f 66 6f |strcmp (|group_fo|
|00004470| 72 6d 61 74 5b 55 4e 43 | 48 41 4e 47 45 44 5d 2c |rmat[UNC|HANGED],|
|00004480| 20 22 25 3d 22 29 20 3d | 3d 20 30 0a 09 20 20 20 | "%=") =|= 0.. |
|00004490| 26 26 20 21 2a 6c 69 6e | 65 5f 66 6f 72 6d 61 74 |&& !*lin|e_format|
|000044a0| 5b 55 4e 43 48 41 4e 47 | 45 44 5d 29 29 0a 20 20 |[UNCHANG|ED])). |
|000044b0| 20 20 20 3a 20 6f 75 74 | 70 75 74 5f 73 74 79 6c | : out|put_styl|
|000044c0| 65 20 3d 3d 20 4f 55 54 | 50 55 54 5f 53 44 49 46 |e == OUT|PUT_SDIF|
|000044d0| 46 20 3f 20 73 64 69 66 | 66 5f 73 6b 69 70 5f 63 |F ? sdif|f_skip_c|
|000044e0| 6f 6d 6d 6f 6e 5f 6c 69 | 6e 65 73 20 3a 20 31 29 |ommon_li|nes : 1)|
|000044f0| 3b 0a 0a 20 20 73 77 69 | 74 63 68 5f 73 74 72 69 |;.. swi|tch_stri|
|00004500| 6e 67 20 3d 20 6f 70 74 | 69 6f 6e 5f 6c 69 73 74 |ng = opt|ion_list|
|00004510| 20 28 61 72 67 76 20 2b | 20 31 2c 20 6f 70 74 69 | (argv +| 1, opti|
|00004520| 6e 64 20 2d 20 31 29 3b | 0a 0a 20 20 76 61 6c 20 |nd - 1);|.. val |
|00004530| 3d 20 63 6f 6d 70 61 72 | 65 5f 66 69 6c 65 73 20 |= compar|e_files |
|00004540| 28 30 2c 20 61 72 67 76 | 5b 6f 70 74 69 6e 64 5d |(0, argv|[optind]|
|00004550| 2c 20 30 2c 20 61 72 67 | 76 5b 6f 70 74 69 6e 64 |, 0, arg|v[optind|
|00004560| 20 2b 20 31 5d 2c 20 30 | 29 3b 0a 0a 20 20 2f 2a | + 1], 0|);.. /*|
|00004570| 20 50 72 69 6e 74 20 61 | 6e 79 20 6d 65 73 73 61 | Print a|ny messa|
|00004580| 67 65 73 20 74 68 61 74 | 20 77 65 72 65 20 73 61 |ges that| were sa|
|00004590| 76 65 64 20 75 70 20 66 | 6f 72 20 6c 61 73 74 2e |ved up f|or last.|
|000045a0| 20 20 2a 2f 0a 20 20 70 | 72 69 6e 74 5f 6d 65 73 | */. p|rint_mes|
|000045b0| 73 61 67 65 5f 71 75 65 | 75 65 20 28 29 3b 0a 0a |sage_que|ue ();..|
|000045c0| 20 20 63 68 65 63 6b 5f | 73 74 64 6f 75 74 20 28 | check_|stdout (|
|000045d0| 29 3b 0a 20 20 65 78 69 | 74 20 28 76 61 6c 29 3b |);. exi|t (val);|
|000045e0| 0a 20 20 72 65 74 75 72 | 6e 20 76 61 6c 3b 0a 7d |. retur|n val;.}|
|000045f0| 0a 0a 2f 2a 20 41 64 64 | 20 74 68 65 20 63 6f 6d |../* Add| the com|
|00004600| 70 69 6c 65 64 20 66 6f | 72 6d 20 6f 66 20 72 65 |piled fo|rm of re|
|00004610| 67 65 78 70 20 50 41 54 | 54 45 52 4e 20 74 6f 20 |gexp PAT|TERN to |
|00004620| 52 45 47 4c 49 53 54 2e | 20 20 2a 2f 0a 0a 73 74 |REGLIST.| */..st|
|00004630| 61 74 69 63 20 76 6f 69 | 64 0a 61 64 64 5f 72 65 |atic voi|d.add_re|
|00004640| 67 65 78 70 20 28 72 65 | 67 6c 69 73 74 2c 20 70 |gexp (re|glist, p|
|00004650| 61 74 74 65 72 6e 29 0a | 20 20 20 20 20 73 74 72 |attern).| str|
|00004660| 75 63 74 20 72 65 67 65 | 78 70 5f 6c 69 73 74 20 |uct rege|xp_list |
|00004670| 2a 2a 72 65 67 6c 69 73 | 74 3b 0a 20 20 20 20 20 |**reglis|t;. |
|00004680| 63 68 61 72 20 63 6f 6e | 73 74 20 2a 70 61 74 74 |char con|st *patt|
|00004690| 65 72 6e 3b 0a 7b 0a 20 | 20 73 74 72 75 63 74 20 |ern;.{. | struct |
|000046a0| 72 65 67 65 78 70 5f 6c | 69 73 74 20 2a 72 3b 0a |regexp_l|ist *r;.|
|000046b0| 20 20 63 68 61 72 20 63 | 6f 6e 73 74 20 2a 6d 3b | char c|onst *m;|
|000046c0| 0a 0a 20 20 72 20 3d 20 | 28 73 74 72 75 63 74 20 |.. r = |(struct |
|000046d0| 72 65 67 65 78 70 5f 6c | 69 73 74 20 2a 29 20 78 |regexp_l|ist *) x|
|000046e0| 6d 61 6c 6c 6f 63 20 28 | 73 69 7a 65 6f 66 20 28 |malloc (|sizeof (|
|000046f0| 2a 72 29 29 3b 0a 20 20 | 62 7a 65 72 6f 20 28 72 |*r));. |bzero (r|
|00004700| 2c 20 73 69 7a 65 6f 66 | 20 28 2a 72 29 29 3b 0a |, sizeof| (*r));.|
|00004710| 20 20 72 2d 3e 62 75 66 | 2e 66 61 73 74 6d 61 70 | r->buf|.fastmap|
|00004720| 20 3d 20 78 6d 61 6c 6c | 6f 63 20 28 32 35 36 29 | = xmall|oc (256)|
|00004730| 3b 0a 20 20 6d 20 3d 20 | 72 65 5f 63 6f 6d 70 69 |;. m = |re_compi|
|00004740| 6c 65 5f 70 61 74 74 65 | 72 6e 20 28 70 61 74 74 |le_patte|rn (patt|
|00004750| 65 72 6e 2c 20 73 74 72 | 6c 65 6e 20 28 70 61 74 |ern, str|len (pat|
|00004760| 74 65 72 6e 29 2c 20 26 | 72 2d 3e 62 75 66 29 3b |tern), &|r->buf);|
|00004770| 0a 20 20 69 66 20 28 6d | 20 21 3d 20 30 29 0a 20 |. if (m| != 0). |
|00004780| 20 20 20 65 72 72 6f 72 | 20 28 22 25 73 3a 20 25 | error| ("%s: %|
|00004790| 73 22 2c 20 70 61 74 74 | 65 72 6e 2c 20 6d 29 3b |s", patt|ern, m);|
|000047a0| 0a 0a 20 20 2f 2a 20 41 | 64 64 20 74 6f 20 74 68 |.. /* A|dd to th|
|000047b0| 65 20 73 74 61 72 74 20 | 6f 66 20 74 68 65 20 6c |e start |of the l|
|000047c0| 69 73 74 2c 20 73 69 6e | 63 65 20 69 74 27 73 20 |ist, sin|ce it's |
|000047d0| 65 61 73 69 65 72 20 74 | 68 61 6e 20 74 68 65 20 |easier t|han the |
|000047e0| 65 6e 64 2e 20 20 2a 2f | 0a 20 20 72 2d 3e 6e 65 |end. */|. r->ne|
|000047f0| 78 74 20 3d 20 2a 72 65 | 67 6c 69 73 74 3b 0a 20 |xt = *re|glist;. |
|00004800| 20 2a 72 65 67 6c 69 73 | 74 20 3d 20 72 3b 0a 7d | *reglis|t = r;.}|
|00004810| 0a 0a 73 74 61 74 69 63 | 20 76 6f 69 64 0a 74 72 |..static| void.tr|
|00004820| 79 5f 68 65 6c 70 20 28 | 72 65 61 73 6f 6e 29 0a |y_help (|reason).|
|00004830| 20 20 20 20 20 63 68 61 | 72 20 63 6f 6e 73 74 20 | cha|r const |
|00004840| 2a 72 65 61 73 6f 6e 3b | 0a 7b 0a 20 20 69 66 20 |*reason;|.{. if |
|00004850| 28 72 65 61 73 6f 6e 29 | 0a 20 20 20 20 65 72 72 |(reason)|. err|
|00004860| 6f 72 20 28 22 25 73 22 | 2c 20 72 65 61 73 6f 6e |or ("%s"|, reason|
|00004870| 2c 20 30 29 3b 0a 20 20 | 65 72 72 6f 72 20 28 22 |, 0);. |error ("|
|00004880| 54 72 79 20 60 25 73 20 | 2d 2d 68 65 6c 70 27 20 |Try `%s |--help' |
|00004890| 66 6f 72 20 6d 6f 72 65 | 20 69 6e 66 6f 72 6d 61 |for more| informa|
|000048a0| 74 69 6f 6e 2e 22 2c 20 | 70 72 6f 67 72 61 6d 5f |tion.", |program_|
|000048b0| 6e 61 6d 65 2c 20 30 29 | 3b 0a 20 20 65 78 69 74 |name, 0)|;. exit|
|000048c0| 20 28 32 29 3b 0a 7d 0a | 0a 73 74 61 74 69 63 20 | (2);.}.|.static |
|000048d0| 76 6f 69 64 0a 63 68 65 | 63 6b 5f 73 74 64 6f 75 |void.che|ck_stdou|
|000048e0| 74 20 28 29 0a 7b 0a 20 | 20 69 66 20 28 66 65 72 |t ().{. | if (fer|
|000048f0| 72 6f 72 20 28 73 74 64 | 6f 75 74 29 20 7c 7c 20 |ror (std|out) || |
|00004900| 66 63 6c 6f 73 65 20 28 | 73 74 64 6f 75 74 29 20 |fclose (|stdout) |
|00004910| 21 3d 20 30 29 0a 20 20 | 20 20 66 61 74 61 6c 20 |!= 0). | fatal |
|00004920| 28 22 77 72 69 74 65 20 | 65 72 72 6f 72 22 29 3b |("write |error");|
|00004930| 0a 7d 0a 0a 73 74 61 74 | 69 63 20 63 68 61 72 20 |.}..stat|ic char |
|00004940| 63 6f 6e 73 74 20 2a 20 | 63 6f 6e 73 74 20 6f 70 |const * |const op|
|00004950| 74 69 6f 6e 5f 68 65 6c | 70 5b 5d 20 3d 20 7b 0a |tion_hel|p[] = {.|
|00004960| 22 2d 69 20 20 2d 2d 69 | 67 6e 6f 72 65 2d 63 61 |"-i --i|gnore-ca|
|00004970| 73 65 20 20 43 6f 6e 73 | 69 64 65 72 20 75 70 70 |se Cons|ider upp|
|00004980| 65 72 2d 20 61 6e 64 20 | 6c 6f 77 65 72 2d 63 61 |er- and |lower-ca|
|00004990| 73 65 20 74 6f 20 62 65 | 20 74 68 65 20 73 61 6d |se to be| the sam|
|000049a0| 65 2e 22 2c 0a 22 2d 77 | 20 20 2d 2d 69 67 6e 6f |e.",."-w| --igno|
|000049b0| 72 65 2d 61 6c 6c 2d 73 | 70 61 63 65 20 20 49 67 |re-all-s|pace Ig|
|000049c0| 6e 6f 72 65 20 61 6c 6c | 20 77 68 69 74 65 20 73 |nore all| white s|
|000049d0| 70 61 63 65 2e 22 2c 0a | 22 2d 62 20 20 2d 2d 69 |pace.",.|"-b --i|
|000049e0| 67 6e 6f 72 65 2d 73 70 | 61 63 65 2d 63 68 61 6e |gnore-sp|ace-chan|
|000049f0| 67 65 20 20 49 67 6e 6f | 72 65 20 63 68 61 6e 67 |ge Igno|re chang|
|00004a00| 65 73 20 69 6e 20 74 68 | 65 20 61 6d 6f 75 6e 74 |es in th|e amount|
|00004a10| 20 6f 66 20 77 68 69 74 | 65 20 73 70 61 63 65 2e | of whit|e space.|
|00004a20| 22 2c 0a 22 2d 42 20 20 | 2d 2d 69 67 6e 6f 72 65 |",."-B |--ignore|
|00004a30| 2d 62 6c 61 6e 6b 2d 6c | 69 6e 65 73 20 20 49 67 |-blank-l|ines Ig|
|00004a40| 6e 6f 72 65 20 63 68 61 | 6e 67 65 73 20 77 68 6f |nore cha|nges who|
|00004a50| 73 65 20 6c 69 6e 65 73 | 20 61 72 65 20 61 6c 6c |se lines| are all|
|00004a60| 20 62 6c 61 6e 6b 2e 22 | 2c 0a 22 2d 49 20 52 45 | blank."|,."-I RE|
|00004a70| 20 20 2d 2d 69 67 6e 6f | 72 65 2d 6d 61 74 63 68 | --igno|re-match|
|00004a80| 69 6e 67 2d 6c 69 6e 65 | 73 3d 52 45 20 20 49 67 |ing-line|s=RE Ig|
|00004a90| 6e 6f 72 65 20 63 68 61 | 6e 67 65 73 20 77 68 6f |nore cha|nges who|
|00004aa0| 73 65 20 6c 69 6e 65 73 | 20 61 6c 6c 20 6d 61 74 |se lines| all mat|
|00004ab0| 63 68 20 52 45 2e 22 2c | 0a 23 69 66 20 48 41 56 |ch RE.",|.#if HAV|
|00004ac0| 45 5f 53 45 54 4d 4f 44 | 45 0a 22 2d 2d 62 69 6e |E_SETMOD|E."--bin|
|00004ad0| 61 72 79 20 20 52 65 61 | 64 20 61 6e 64 20 77 72 |ary Rea|d and wr|
|00004ae0| 69 74 65 20 64 61 74 61 | 20 69 6e 20 62 69 6e 61 |ite data| in bina|
|00004af0| 72 79 20 6d 6f 64 65 2e | 22 2c 0a 23 65 6e 64 69 |ry mode.|",.#endi|
|00004b00| 66 0a 22 2d 61 20 20 2d | 2d 74 65 78 74 20 20 54 |f."-a -|-text T|
|00004b10| 72 65 61 74 20 61 6c 6c | 20 66 69 6c 65 73 20 61 |reat all| files a|
|00004b20| 73 20 74 65 78 74 2e 5c | 6e 22 2c 0a 22 2d 63 20 |s text.\|n",."-c |
|00004b30| 20 2d 43 20 4e 55 4d 20 | 20 2d 2d 63 6f 6e 74 65 | -C NUM | --conte|
|00004b40| 78 74 5b 3d 4e 55 4d 5d | 20 20 4f 75 74 70 75 74 |xt[=NUM]| Output|
|00004b50| 20 4e 55 4d 20 28 64 65 | 66 61 75 6c 74 20 32 29 | NUM (de|fault 2)|
|00004b60| 20 6c 69 6e 65 73 20 6f | 66 20 63 6f 70 69 65 64 | lines o|f copied|
|00004b70| 20 63 6f 6e 74 65 78 74 | 2e 22 2c 0a 22 2d 75 20 | context|.",."-u |
|00004b80| 20 2d 55 20 4e 55 4d 20 | 20 2d 2d 75 6e 69 66 69 | -U NUM | --unifi|
|00004b90| 65 64 5b 3d 4e 55 4d 5d | 20 20 4f 75 74 70 75 74 |ed[=NUM]| Output|
|00004ba0| 20 4e 55 4d 20 28 64 65 | 66 61 75 6c 74 20 32 29 | NUM (de|fault 2)|
|00004bb0| 20 6c 69 6e 65 73 20 6f | 66 20 75 6e 69 66 69 65 | lines o|f unifie|
|00004bc0| 64 20 63 6f 6e 74 65 78 | 74 2e 22 2c 0a 22 20 20 |d contex|t.",." |
|00004bd0| 2d 4e 55 4d 20 20 55 73 | 65 20 4e 55 4d 20 63 6f |-NUM Us|e NUM co|
|00004be0| 6e 74 65 78 74 20 6c 69 | 6e 65 73 2e 22 2c 0a 22 |ntext li|nes.",."|
|00004bf0| 20 20 2d 4c 20 4c 41 42 | 45 4c 20 20 2d 2d 6c 61 | -L LAB|EL --la|
|00004c00| 62 65 6c 20 4c 41 42 45 | 4c 20 20 55 73 65 20 4c |bel LABE|L Use L|
|00004c10| 41 42 45 4c 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |ABEL ins|tead of |
|00004c20| 66 69 6c 65 20 6e 61 6d | 65 2e 22 2c 0a 22 20 20 |file nam|e.",." |
|00004c30| 2d 70 20 20 2d 2d 73 68 | 6f 77 2d 63 2d 66 75 6e |-p --sh|ow-c-fun|
|00004c40| 63 74 69 6f 6e 20 20 53 | 68 6f 77 20 77 68 69 63 |ction S|how whic|
|00004c50| 68 20 43 20 66 75 6e 63 | 74 69 6f 6e 20 65 61 63 |h C func|tion eac|
|00004c60| 68 20 63 68 61 6e 67 65 | 20 69 73 20 69 6e 2e 22 |h change| is in."|
|00004c70| 2c 0a 22 20 20 2d 46 20 | 52 45 20 20 2d 2d 73 68 |,." -F |RE --sh|
|00004c80| 6f 77 2d 66 75 6e 63 74 | 69 6f 6e 2d 6c 69 6e 65 |ow-funct|ion-line|
|00004c90| 3d 52 45 20 20 53 68 6f | 77 20 74 68 65 20 6d 6f |=RE Sho|w the mo|
|00004ca0| 73 74 20 72 65 63 65 6e | 74 20 6c 69 6e 65 20 6d |st recen|t line m|
|00004cb0| 61 74 63 68 69 6e 67 20 | 52 45 2e 22 2c 0a 22 2d |atching |RE.",."-|
|00004cc0| 71 20 20 2d 2d 62 72 69 | 65 66 20 20 4f 75 74 70 |q --bri|ef Outp|
|00004cd0| 75 74 20 6f 6e 6c 79 20 | 77 68 65 74 68 65 72 20 |ut only |whether |
|00004ce0| 66 69 6c 65 73 20 64 69 | 66 66 65 72 2e 22 2c 0a |files di|ffer.",.|
|00004cf0| 22 2d 65 20 20 2d 2d 65 | 64 20 20 4f 75 74 70 75 |"-e --e|d Outpu|
|00004d00| 74 20 61 6e 20 65 64 20 | 73 63 72 69 70 74 2e 22 |t an ed |script."|
|00004d10| 2c 0a 22 2d 6e 20 20 2d | 2d 72 63 73 20 20 4f 75 |,."-n -|-rcs Ou|
|00004d20| 74 70 75 74 20 61 6e 20 | 52 43 53 20 66 6f 72 6d |tput an |RCS form|
|00004d30| 61 74 20 64 69 66 66 2e | 22 2c 0a 22 2d 79 20 20 |at diff.|",."-y |
|00004d40| 2d 2d 73 69 64 65 2d 62 | 79 2d 73 69 64 65 20 20 |--side-b|y-side |
|00004d50| 4f 75 74 70 75 74 20 69 | 6e 20 74 77 6f 20 63 6f |Output i|n two co|
|00004d60| 6c 75 6d 6e 73 2e 22 2c | 0a 22 20 20 2d 77 20 4e |lumns.",|." -w N|
|00004d70| 55 4d 20 20 2d 2d 77 69 | 64 74 68 3d 4e 55 4d 20 |UM --wi|dth=NUM |
|00004d80| 20 4f 75 74 70 75 74 20 | 61 74 20 6d 6f 73 74 20 | Output |at most |
|00004d90| 4e 55 4d 20 28 64 65 66 | 61 75 6c 74 20 31 33 30 |NUM (def|ault 130|
|00004da0| 29 20 63 68 61 72 61 63 | 74 65 72 73 20 70 65 72 |) charac|ters per|
|00004db0| 20 6c 69 6e 65 2e 22 2c | 0a 22 20 20 2d 2d 6c 65 | line.",|." --le|
|00004dc0| 66 74 2d 63 6f 6c 75 6d | 6e 20 20 4f 75 74 70 75 |ft-colum|n Outpu|
|00004dd0| 74 20 6f 6e 6c 79 20 74 | 68 65 20 6c 65 66 74 20 |t only t|he left |
|00004de0| 63 6f 6c 75 6d 6e 20 6f | 66 20 63 6f 6d 6d 6f 6e |column o|f common|
|00004df0| 20 6c 69 6e 65 73 2e 22 | 2c 0a 22 20 20 2d 2d 73 | lines."|,." --s|
|00004e00| 75 70 70 72 65 73 73 2d | 63 6f 6d 6d 6f 6e 2d 6c |uppress-|common-l|
|00004e10| 69 6e 65 73 20 20 44 6f | 20 6e 6f 74 20 6f 75 74 |ines Do| not out|
|00004e20| 70 75 74 20 63 6f 6d 6d | 6f 6e 20 6c 69 6e 65 73 |put comm|on lines|
|00004e30| 2e 22 2c 0a 22 2d 44 4e | 41 4d 45 20 20 2d 2d 69 |.",."-DN|AME --i|
|00004e40| 66 64 65 66 3d 4e 41 4d | 45 20 20 4f 75 74 70 75 |fdef=NAM|E Outpu|
|00004e50| 74 20 6d 65 72 67 65 64 | 20 66 69 6c 65 20 74 6f |t merged| file to|
|00004e60| 20 73 68 6f 77 20 60 23 | 69 66 64 65 66 20 4e 41 | show `#|ifdef NA|
|00004e70| 4d 45 27 20 64 69 66 66 | 73 2e 22 2c 0a 22 2d 2d |ME' diff|s.",."--|
|00004e80| 47 54 59 50 45 2d 67 72 | 6f 75 70 2d 66 6f 72 6d |GTYPE-gr|oup-form|
|00004e90| 61 74 3d 47 46 4d 54 20 | 20 53 69 6d 69 6c 61 72 |at=GFMT | Similar|
|00004ea0| 2c 20 62 75 74 20 66 6f | 72 6d 61 74 20 47 54 59 |, but fo|rmat GTY|
|00004eb0| 50 45 20 69 6e 70 75 74 | 20 67 72 6f 75 70 73 20 |PE input| groups |
|00004ec0| 77 69 74 68 20 47 46 4d | 54 2e 22 2c 0a 22 2d 2d |with GFM|T.",."--|
|00004ed0| 6c 69 6e 65 2d 66 6f 72 | 6d 61 74 3d 4c 46 4d 54 |line-for|mat=LFMT|
|00004ee0| 20 20 53 69 6d 69 6c 61 | 72 2c 20 62 75 74 20 66 | Simila|r, but f|
|00004ef0| 6f 72 6d 61 74 20 61 6c | 6c 20 69 6e 70 75 74 20 |ormat al|l input |
|00004f00| 6c 69 6e 65 73 20 77 69 | 74 68 20 4c 46 4d 54 2e |lines wi|th LFMT.|
|00004f10| 22 2c 0a 22 2d 2d 4c 54 | 59 50 45 2d 6c 69 6e 65 |",."--LT|YPE-line|
|00004f20| 2d 66 6f 72 6d 61 74 3d | 4c 46 4d 54 20 20 53 69 |-format=|LFMT Si|
|00004f30| 6d 69 6c 61 72 2c 20 62 | 75 74 20 66 6f 72 6d 61 |milar, b|ut forma|
|00004f40| 74 20 4c 54 59 50 45 20 | 69 6e 70 75 74 20 6c 69 |t LTYPE |input li|
|00004f50| 6e 65 73 20 77 69 74 68 | 20 4c 46 4d 54 2e 22 2c |nes with| LFMT.",|
|00004f60| 0a 22 20 20 4c 54 59 50 | 45 20 69 73 20 60 6f 6c |." LTYP|E is `ol|
|00004f70| 64 27 2c 20 60 6e 65 77 | 27 2c 20 6f 72 20 60 75 |d', `new|', or `u|
|00004f80| 6e 63 68 61 6e 67 65 64 | 27 2e 20 20 47 54 59 50 |nchanged|'. GTYP|
|00004f90| 45 20 69 73 20 4c 54 59 | 50 45 20 6f 72 20 60 63 |E is LTY|PE or `c|
|00004fa0| 68 61 6e 67 65 64 27 2e | 22 2c 0a 22 20 20 47 46 |hanged'.|",." GF|
|00004fb0| 4d 54 20 6d 61 79 20 63 | 6f 6e 74 61 69 6e 3a 22 |MT may c|ontain:"|
|00004fc0| 2c 0a 22 20 20 20 20 25 | 3c 20 20 6c 69 6e 65 73 |,." %|< lines|
|00004fd0| 20 66 72 6f 6d 20 46 49 | 4c 45 31 22 2c 0a 22 20 | from FI|LE1",." |
|00004fe0| 20 20 20 25 3e 20 20 6c | 69 6e 65 73 20 66 72 6f | %> l|ines fro|
|00004ff0| 6d 20 46 49 4c 45 32 22 | 2c 0a 22 20 20 20 20 25 |m FILE2"|,." %|
|00005000| 3d 20 20 6c 69 6e 65 73 | 20 63 6f 6d 6d 6f 6e 20 |= lines| common |
|00005010| 74 6f 20 46 49 4c 45 31 | 20 61 6e 64 20 46 49 4c |to FILE1| and FIL|
|00005020| 45 32 22 2c 0a 22 20 20 | 20 20 25 5b 2d 5d 5b 57 |E2",." | %[-][W|
|00005030| 49 44 54 48 5d 5b 2e 5b | 50 52 45 43 5d 5d 7b 64 |IDTH][.[|PREC]]{d|
|00005040| 6f 78 58 7d 4c 45 54 54 | 45 52 20 20 70 72 69 6e |oxX}LETT|ER prin|
|00005050| 74 66 2d 73 74 79 6c 65 | 20 73 70 65 63 20 66 6f |tf-style| spec fo|
|00005060| 72 20 4c 45 54 54 45 52 | 22 2c 0a 22 20 20 20 20 |r LETTER|",." |
|00005070| 20 20 4c 45 54 54 45 52 | 73 20 61 72 65 20 61 73 | LETTER|s are as|
|00005080| 20 66 6f 6c 6c 6f 77 73 | 20 66 6f 72 20 6e 65 77 | follows| for new|
|00005090| 20 67 72 6f 75 70 2c 20 | 6c 6f 77 65 72 20 63 61 | group, |lower ca|
|000050a0| 73 65 20 66 6f 72 20 6f | 6c 64 20 67 72 6f 75 70 |se for o|ld group|
|000050b0| 3a 22 2c 0a 22 20 20 20 | 20 20 20 20 20 46 20 20 |:",." | F |
|000050c0| 66 69 72 73 74 20 6c 69 | 6e 65 20 6e 75 6d 62 65 |first li|ne numbe|
|000050d0| 72 22 2c 0a 22 20 20 20 | 20 20 20 20 20 4c 20 20 |r",." | L |
|000050e0| 6c 61 73 74 20 6c 69 6e | 65 20 6e 75 6d 62 65 72 |last lin|e number|
|000050f0| 22 2c 0a 22 20 20 20 20 | 20 20 20 20 4e 20 20 6e |",." | N n|
|00005100| 75 6d 62 65 72 20 6f 66 | 20 6c 69 6e 65 73 20 3d |umber of| lines =|
|00005110| 20 4c 2d 46 2b 31 22 2c | 0a 22 20 20 20 20 20 20 | L-F+1",|." |
|00005120| 20 20 45 20 20 46 2d 31 | 22 2c 0a 22 20 20 20 20 | E F-1|",." |
|00005130| 20 20 20 20 4d 20 20 4c | 2b 31 22 2c 0a 22 20 20 | M L|+1",." |
|00005140| 4c 46 4d 54 20 6d 61 79 | 20 63 6f 6e 74 61 69 6e |LFMT may| contain|
|00005150| 3a 22 2c 0a 22 20 20 20 | 20 25 4c 20 20 63 6f 6e |:",." | %L con|
|00005160| 74 65 6e 74 73 20 6f 66 | 20 6c 69 6e 65 22 2c 0a |tents of| line",.|
|00005170| 22 20 20 20 20 25 6c 20 | 20 63 6f 6e 74 65 6e 74 |" %l | content|
|00005180| 73 20 6f 66 20 6c 69 6e | 65 2c 20 65 78 63 6c 75 |s of lin|e, exclu|
|00005190| 64 69 6e 67 20 61 6e 79 | 20 74 72 61 69 6c 69 6e |ding any| trailin|
|000051a0| 67 20 6e 65 77 6c 69 6e | 65 22 2c 0a 22 20 20 20 |g newlin|e",." |
|000051b0| 20 25 5b 2d 5d 5b 57 49 | 44 54 48 5d 5b 2e 5b 50 | %[-][WI|DTH][.[P|
|000051c0| 52 45 43 5d 5d 7b 64 6f | 78 58 7d 6e 20 20 70 72 |REC]]{do|xX}n pr|
|000051d0| 69 6e 74 66 2d 73 74 79 | 6c 65 20 73 70 65 63 20 |intf-sty|le spec |
|000051e0| 66 6f 72 20 69 6e 70 75 | 74 20 6c 69 6e 65 20 6e |for inpu|t line n|
|000051f0| 75 6d 62 65 72 22 2c 0a | 22 20 20 45 69 74 68 65 |umber",.|" Eithe|
|00005200| 72 20 47 46 4d 54 20 6f | 72 20 4c 46 4d 54 20 6d |r GFMT o|r LFMT m|
|00005210| 61 79 20 63 6f 6e 74 61 | 69 6e 3a 22 2c 0a 22 20 |ay conta|in:",." |
|00005220| 20 20 20 25 25 20 20 25 | 22 2c 0a 22 20 20 20 20 | %% %|",." |
|00005230| 25 63 27 43 27 20 20 74 | 68 65 20 73 69 6e 67 6c |%c'C' t|he singl|
|00005240| 65 20 63 68 61 72 61 63 | 74 65 72 20 43 22 2c 0a |e charac|ter C",.|
|00005250| 22 20 20 20 20 25 63 27 | 5c 5c 4f 4f 4f 27 20 20 |" %c'|\\OOO' |
|00005260| 74 68 65 20 63 68 61 72 | 61 63 74 65 72 20 77 69 |the char|acter wi|
|00005270| 74 68 20 6f 63 74 61 6c | 20 63 6f 64 65 20 4f 4f |th octal| code OO|
|00005280| 4f 5c 6e 22 2c 0a 22 2d | 6c 20 20 2d 2d 70 61 67 |O\n",."-|l --pag|
|00005290| 69 6e 61 74 65 20 20 50 | 61 73 73 20 74 68 65 20 |inate P|ass the |
|000052a0| 6f 75 74 70 75 74 20 74 | 68 72 6f 75 67 68 20 60 |output t|hrough `|
|000052b0| 70 72 27 20 74 6f 20 70 | 61 67 69 6e 61 74 65 20 |pr' to p|aginate |
|000052c0| 69 74 2e 22 2c 0a 22 2d | 74 20 20 2d 2d 65 78 70 |it.",."-|t --exp|
|000052d0| 61 6e 64 2d 74 61 62 73 | 20 20 45 78 70 61 6e 64 |and-tabs| Expand|
|000052e0| 20 74 61 62 73 20 74 6f | 20 73 70 61 63 65 73 20 | tabs to| spaces |
|000052f0| 69 6e 20 6f 75 74 70 75 | 74 2e 22 2c 0a 22 2d 54 |in outpu|t.",."-T|
|00005300| 20 20 2d 2d 69 6e 69 74 | 69 61 6c 2d 74 61 62 20 | --init|ial-tab |
|00005310| 20 4d 61 6b 65 20 74 61 | 62 73 20 6c 69 6e 65 20 | Make ta|bs line |
|00005320| 75 70 20 62 79 20 70 72 | 65 70 65 6e 64 69 6e 67 |up by pr|epending|
|00005330| 20 61 20 74 61 62 2e 5c | 6e 22 2c 0a 22 2d 72 20 | a tab.\|n",."-r |
|00005340| 20 2d 2d 72 65 63 75 72 | 73 69 76 65 20 20 52 65 | --recur|sive Re|
|00005350| 63 75 72 73 69 76 65 6c | 79 20 63 6f 6d 70 61 72 |cursivel|y compar|
|00005360| 65 20 61 6e 79 20 73 75 | 62 64 69 72 65 63 74 6f |e any su|bdirecto|
|00005370| 72 69 65 73 20 66 6f 75 | 6e 64 2e 22 2c 0a 22 2d |ries fou|nd.",."-|
|00005380| 4e 20 20 2d 2d 6e 65 77 | 2d 66 69 6c 65 20 20 54 |N --new|-file T|
|00005390| 72 65 61 74 20 61 62 73 | 65 6e 74 20 66 69 6c 65 |reat abs|ent file|
|000053a0| 73 20 61 73 20 65 6d 70 | 74 79 2e 22 2c 0a 22 2d |s as emp|ty.",."-|
|000053b0| 50 20 20 2d 2d 75 6e 69 | 64 69 72 65 63 74 69 6f |P --uni|directio|
|000053c0| 6e 61 6c 2d 6e 65 77 2d | 66 69 6c 65 20 20 54 72 |nal-new-|file Tr|
|000053d0| 65 61 74 20 61 62 73 65 | 6e 74 20 66 69 72 73 74 |eat abse|nt first|
|000053e0| 20 66 69 6c 65 73 20 61 | 73 20 65 6d 70 74 79 2e | files a|s empty.|
|000053f0| 22 2c 0a 22 2d 73 20 20 | 2d 2d 72 65 70 6f 72 74 |",."-s |--report|
|00005400| 2d 69 64 65 6e 74 69 63 | 61 6c 2d 66 69 6c 65 73 |-identic|al-files|
|00005410| 20 20 52 65 70 6f 72 74 | 20 77 68 65 6e 20 74 77 | Report| when tw|
|00005420| 6f 20 66 69 6c 65 73 20 | 61 72 65 20 74 68 65 20 |o files |are the |
|00005430| 73 61 6d 65 2e 22 2c 0a | 22 2d 78 20 50 41 54 20 |same.",.|"-x PAT |
|00005440| 20 2d 2d 65 78 63 6c 75 | 64 65 3d 50 41 54 20 20 | --exclu|de=PAT |
|00005450| 45 78 63 6c 75 64 65 20 | 66 69 6c 65 73 20 74 68 |Exclude |files th|
|00005460| 61 74 20 6d 61 74 63 68 | 20 50 41 54 2e 22 2c 0a |at match| PAT.",.|
|00005470| 22 2d 58 20 46 49 4c 45 | 20 20 2d 2d 65 78 63 6c |"-X FILE| --excl|
|00005480| 75 64 65 2d 66 72 6f 6d | 3d 46 49 4c 45 20 20 45 |ude-from|=FILE E|
|00005490| 78 63 6c 75 64 65 20 66 | 69 6c 65 73 20 74 68 61 |xclude f|iles tha|
|000054a0| 74 20 6d 61 74 63 68 20 | 61 6e 79 20 70 61 74 74 |t match |any patt|
|000054b0| 65 72 6e 20 69 6e 20 46 | 49 4c 45 2e 22 2c 0a 22 |ern in F|ILE.",."|
|000054c0| 2d 53 20 46 49 4c 45 20 | 20 2d 2d 73 74 61 72 74 |-S FILE | --start|
|000054d0| 69 6e 67 2d 66 69 6c 65 | 3d 46 49 4c 45 20 20 53 |ing-file|=FILE S|
|000054e0| 74 61 72 74 20 77 69 74 | 68 20 46 49 4c 45 20 77 |tart wit|h FILE w|
|000054f0| 68 65 6e 20 63 6f 6d 70 | 61 72 69 6e 67 20 64 69 |hen comp|aring di|
|00005500| 72 65 63 74 6f 72 69 65 | 73 2e 5c 6e 22 2c 0a 22 |rectorie|s.\n",."|
|00005510| 2d 2d 68 6f 72 69 7a 6f | 6e 2d 6c 69 6e 65 73 3d |--horizo|n-lines=|
|00005520| 4e 55 4d 20 20 4b 65 65 | 70 20 4e 55 4d 20 6c 69 |NUM Kee|p NUM li|
|00005530| 6e 65 73 20 6f 66 20 74 | 68 65 20 63 6f 6d 6d 6f |nes of t|he commo|
|00005540| 6e 20 70 72 65 66 69 78 | 20 61 6e 64 20 73 75 66 |n prefix| and suf|
|00005550| 66 69 78 2e 22 2c 0a 22 | 2d 64 20 20 2d 2d 6d 69 |fix.",."|-d --mi|
|00005560| 6e 69 6d 61 6c 20 20 54 | 72 79 20 68 61 72 64 20 |nimal T|ry hard |
|00005570| 74 6f 20 66 69 6e 64 20 | 61 20 73 6d 61 6c 6c 65 |to find |a smalle|
|00005580| 72 20 73 65 74 20 6f 66 | 20 63 68 61 6e 67 65 73 |r set of| changes|
|00005590| 2e 22 2c 0a 22 2d 48 20 | 20 2d 2d 73 70 65 65 64 |.",."-H | --speed|
|000055a0| 2d 6c 61 72 67 65 2d 66 | 69 6c 65 73 20 20 41 73 |-large-f|iles As|
|000055b0| 73 75 6d 65 20 6c 61 72 | 67 65 20 66 69 6c 65 73 |sume lar|ge files|
|000055c0| 20 61 6e 64 20 6d 61 6e | 79 20 73 63 61 74 74 65 | and man|y scatte|
|000055d0| 72 65 64 20 73 6d 61 6c | 6c 20 63 68 61 6e 67 65 |red smal|l change|
|000055e0| 73 2e 5c 6e 22 2c 0a 22 | 2d 76 20 20 2d 2d 76 65 |s.\n",."|-v --ve|
|000055f0| 72 73 69 6f 6e 20 20 4f | 75 74 70 75 74 20 76 65 |rsion O|utput ve|
|00005600| 72 73 69 6f 6e 20 69 6e | 66 6f 2e 22 2c 0a 22 2d |rsion in|fo.",."-|
|00005610| 2d 68 65 6c 70 20 20 4f | 75 74 70 75 74 20 74 68 |-help O|utput th|
|00005620| 69 73 20 68 65 6c 70 2e | 22 2c 0a 30 0a 7d 3b 0a |is help.|",.0.};.|
|00005630| 0a 73 74 61 74 69 63 20 | 76 6f 69 64 0a 75 73 61 |.static |void.usa|
|00005640| 67 65 20 28 29 0a 7b 0a | 20 20 63 68 61 72 20 63 |ge ().{.| char c|
|00005650| 6f 6e 73 74 20 2a 20 63 | 6f 6e 73 74 20 2a 70 3b |onst * c|onst *p;|
|00005660| 0a 0a 20 20 70 72 69 6e | 74 66 20 28 22 55 73 61 |.. prin|tf ("Usa|
|00005670| 67 65 3a 20 25 73 20 5b | 4f 50 54 49 4f 4e 5d 2e |ge: %s [|OPTION].|
|00005680| 2e 2e 20 46 49 4c 45 31 | 20 46 49 4c 45 32 5c 6e |.. FILE1| FILE2\n|
|00005690| 5c 6e 22 2c 20 70 72 6f | 67 72 61 6d 5f 6e 61 6d |\n", pro|gram_nam|
|000056a0| 65 29 3b 0a 20 20 66 6f | 72 20 28 70 20 3d 20 6f |e);. fo|r (p = o|
|000056b0| 70 74 69 6f 6e 5f 68 65 | 6c 70 3b 20 20 2a 70 3b |ption_he|lp; *p;|
|000056c0| 20 20 70 2b 2b 29 0a 20 | 20 20 20 70 72 69 6e 74 | p++). | print|
|000056d0| 66 20 28 22 20 20 25 73 | 5c 6e 22 2c 20 2a 70 29 |f (" %s|\n", *p)|
|000056e0| 3b 0a 20 20 70 72 69 6e | 74 66 20 28 22 5c 6e 49 |;. prin|tf ("\nI|
|000056f0| 66 20 46 49 4c 45 31 20 | 6f 72 20 46 49 4c 45 32 |f FILE1 |or FILE2|
|00005700| 20 69 73 20 60 2d 27 2c | 20 72 65 61 64 20 73 74 | is `-',| read st|
|00005710| 61 6e 64 61 72 64 20 69 | 6e 70 75 74 2e 5c 6e 22 |andard i|nput.\n"|
|00005720| 29 3b 0a 7d 0a 0a 73 74 | 61 74 69 63 20 69 6e 74 |);.}..st|atic int|
|00005730| 0a 73 70 65 63 69 66 79 | 5f 66 6f 72 6d 61 74 20 |.specify|_format |
|00005740| 28 76 61 72 2c 20 76 61 | 6c 75 65 29 0a 20 20 20 |(var, va|lue). |
|00005750| 20 20 63 68 61 72 20 2a | 2a 76 61 72 3b 0a 20 20 | char *|*var;. |
|00005760| 20 20 20 63 68 61 72 20 | 2a 76 61 6c 75 65 3b 0a | char |*value;.|
|00005770| 7b 0a 20 20 69 6e 74 20 | 65 72 72 20 3d 20 2a 76 |{. int |err = *v|
|00005780| 61 72 20 3f 20 73 74 72 | 63 6d 70 20 28 2a 76 61 |ar ? str|cmp (*va|
|00005790| 72 2c 20 76 61 6c 75 65 | 29 20 3a 20 30 3b 0a 20 |r, value|) : 0;. |
|000057a0| 20 2a 76 61 72 20 3d 20 | 76 61 6c 75 65 3b 0a 20 | *var = |value;. |
|000057b0| 20 72 65 74 75 72 6e 20 | 65 72 72 3b 0a 7d 0a 0a | return |err;.}..|
|000057c0| 73 74 61 74 69 63 20 76 | 6f 69 64 0a 73 70 65 63 |static v|oid.spec|
|000057d0| 69 66 79 5f 73 74 79 6c | 65 20 28 73 74 79 6c 65 |ify_styl|e (style|
|000057e0| 29 0a 20 20 20 20 20 65 | 6e 75 6d 20 6f 75 74 70 |). e|num outp|
|000057f0| 75 74 5f 73 74 79 6c 65 | 20 73 74 79 6c 65 3b 0a |ut_style| style;.|
|00005800| 7b 0a 20 20 69 66 20 28 | 6f 75 74 70 75 74 5f 73 |{. if (|output_s|
|00005810| 74 79 6c 65 20 21 3d 20 | 4f 55 54 50 55 54 5f 4e |tyle != |OUTPUT_N|
|00005820| 4f 52 4d 41 4c 0a 20 20 | 20 20 20 20 26 26 20 6f |ORMAL. | && o|
|00005830| 75 74 70 75 74 5f 73 74 | 79 6c 65 20 21 3d 20 73 |utput_st|yle != s|
|00005840| 74 79 6c 65 29 0a 20 20 | 20 20 65 72 72 6f 72 20 |tyle). | error |
|00005850| 28 22 63 6f 6e 66 6c 69 | 63 74 69 6e 67 20 73 70 |("confli|cting sp|
|00005860| 65 63 69 66 69 63 61 74 | 69 6f 6e 73 20 6f 66 20 |ecificat|ions of |
|00005870| 6f 75 74 70 75 74 20 73 | 74 79 6c 65 22 2c 20 30 |output s|tyle", 0|
|00005880| 2c 20 30 29 3b 0a 20 20 | 6f 75 74 70 75 74 5f 73 |, 0);. |output_s|
|00005890| 74 79 6c 65 20 3d 20 73 | 74 79 6c 65 3b 0a 7d 0a |tyle = s|tyle;.}.|
|000058a0| 0c 0a 73 74 61 74 69 63 | 20 63 68 61 72 20 63 6f |..static| char co|
|000058b0| 6e 73 74 20 2a 0a 66 69 | 6c 65 74 79 70 65 20 28 |nst *.fi|letype (|
|000058c0| 73 74 29 0a 20 20 20 20 | 20 73 74 72 75 63 74 20 |st). | struct |
|000058d0| 73 74 61 74 20 63 6f 6e | 73 74 20 2a 73 74 3b 0a |stat con|st *st;.|
|000058e0| 7b 0a 20 20 2f 2a 20 53 | 65 65 20 50 6f 73 69 78 |{. /* S|ee Posix|
|000058f0| 2e 32 20 73 65 63 74 69 | 6f 6e 20 34 2e 31 37 2e |.2 secti|on 4.17.|
|00005900| 36 2e 31 2e 31 20 61 6e | 64 20 54 61 62 6c 65 20 |6.1.1 an|d Table |
|00005910| 35 2d 31 20 66 6f 72 20 | 74 68 65 73 65 20 66 6f |5-1 for |these fo|
|00005920| 72 6d 61 74 73 2e 0a 20 | 20 20 20 20 54 6f 20 6b |rmats.. | To k|
|00005930| 65 65 70 20 64 69 61 67 | 6e 6f 73 74 69 63 73 20 |eep diag|nostics |
|00005940| 67 72 61 6d 6d 61 74 69 | 63 61 6c 2c 20 74 68 65 |grammati|cal, the|
|00005950| 20 72 65 74 75 72 6e 65 | 64 20 73 74 72 69 6e 67 | returne|d string|
|00005960| 20 6d 75 73 74 20 73 74 | 61 72 74 0a 20 20 20 20 | must st|art. |
|00005970| 20 77 69 74 68 20 61 20 | 63 6f 6e 73 6f 6e 61 6e | with a |consonan|
|00005980| 74 2e 20 20 2a 2f 0a 0a | 20 20 69 66 20 28 53 5f |t. */..| if (S_|
|00005990| 49 53 52 45 47 20 28 73 | 74 2d 3e 73 74 5f 6d 6f |ISREG (s|t->st_mo|
|000059a0| 64 65 29 29 0a 20 20 20 | 20 7b 0a 20 20 20 20 20 |de)). | {. |
|000059b0| 20 69 66 20 28 73 74 2d | 3e 73 74 5f 73 69 7a 65 | if (st-|>st_size|
|000059c0| 20 3d 3d 20 30 29 0a 09 | 72 65 74 75 72 6e 20 22 | == 0)..|return "|
|000059d0| 72 65 67 75 6c 61 72 20 | 65 6d 70 74 79 20 66 69 |regular |empty fi|
|000059e0| 6c 65 22 3b 0a 20 20 20 | 20 20 20 2f 2a 20 50 6f |le";. | /* Po|
|000059f0| 73 69 78 2e 32 20 73 65 | 63 74 69 6f 6e 20 35 2e |six.2 se|ction 5.|
|00005a00| 31 34 2e 32 20 73 65 65 | 6d 73 20 74 6f 20 73 75 |14.2 see|ms to su|
|00005a10| 67 67 65 73 74 20 74 68 | 61 74 20 77 65 20 6d 75 |ggest th|at we mu|
|00005a20| 73 74 20 72 65 61 64 20 | 74 68 65 20 66 69 6c 65 |st read |the file|
|00005a30| 0a 09 20 61 6e 64 20 67 | 75 65 73 73 20 77 68 65 |.. and g|uess whe|
|00005a40| 74 68 65 72 20 69 74 27 | 73 20 43 2c 20 46 6f 72 |ther it'|s C, For|
|00005a50| 74 72 61 6e 2c 20 65 74 | 63 2e 2c 20 62 75 74 20 |tran, et|c., but |
|00005a60| 74 68 69 73 20 69 73 20 | 73 6f 6d 65 77 68 61 74 |this is |somewhat|
|00005a70| 20 75 73 65 6c 65 73 73 | 0a 09 20 61 6e 64 20 64 | useless|.. and d|
|00005a80| 6f 65 73 6e 27 74 20 72 | 65 66 6c 65 63 74 20 68 |oesn't r|eflect h|
|00005a90| 69 73 74 6f 72 69 63 61 | 6c 20 70 72 61 63 74 69 |istorica|l practi|
|00005aa0| 63 65 2e 20 20 57 65 27 | 72 65 20 61 6c 6c 6f 77 |ce. We'|re allow|
|00005ab0| 65 64 20 74 6f 20 67 75 | 65 73 73 0a 09 20 77 72 |ed to gu|ess.. wr|
|00005ac0| 6f 6e 67 2c 20 73 6f 20 | 77 65 20 64 6f 6e 27 74 |ong, so |we don't|
|00005ad0| 20 62 6f 74 68 65 72 20 | 74 6f 20 72 65 61 64 20 | bother |to read |
|00005ae0| 74 68 65 20 66 69 6c 65 | 2e 20 20 2a 2f 0a 20 20 |the file|. */. |
|00005af0| 20 20 20 20 72 65 74 75 | 72 6e 20 22 72 65 67 75 | retu|rn "regu|
|00005b00| 6c 61 72 20 66 69 6c 65 | 22 3b 0a 20 20 20 20 7d |lar file|";. }|
|00005b10| 0a 20 20 69 66 20 28 53 | 5f 49 53 44 49 52 20 28 |. if (S|_ISDIR (|
|00005b20| 73 74 2d 3e 73 74 5f 6d | 6f 64 65 29 29 20 72 65 |st->st_m|ode)) re|
|00005b30| 74 75 72 6e 20 22 64 69 | 72 65 63 74 6f 72 79 22 |turn "di|rectory"|
|00005b40| 3b 0a 0a 20 20 2f 2a 20 | 6f 74 68 65 72 20 50 6f |;.. /* |other Po|
|00005b50| 73 69 78 2e 31 20 66 69 | 6c 65 20 74 79 70 65 73 |six.1 fi|le types|
|00005b60| 20 2a 2f 0a 23 69 66 64 | 65 66 20 53 5f 49 53 42 | */.#ifd|ef S_ISB|
|00005b70| 4c 4b 0a 20 20 69 66 20 | 28 53 5f 49 53 42 4c 4b |LK. if |(S_ISBLK|
|00005b80| 20 28 73 74 2d 3e 73 74 | 5f 6d 6f 64 65 29 29 20 | (st->st|_mode)) |
|00005b90| 72 65 74 75 72 6e 20 22 | 62 6c 6f 63 6b 20 73 70 |return "|block sp|
|00005ba0| 65 63 69 61 6c 20 66 69 | 6c 65 22 3b 0a 23 65 6e |ecial fi|le";.#en|
|00005bb0| 64 69 66 0a 23 69 66 64 | 65 66 20 53 5f 49 53 43 |dif.#ifd|ef S_ISC|
|00005bc0| 48 52 0a 20 20 69 66 20 | 28 53 5f 49 53 43 48 52 |HR. if |(S_ISCHR|
|00005bd0| 20 28 73 74 2d 3e 73 74 | 5f 6d 6f 64 65 29 29 20 | (st->st|_mode)) |
|00005be0| 72 65 74 75 72 6e 20 22 | 63 68 61 72 61 63 74 65 |return "|characte|
|00005bf0| 72 20 73 70 65 63 69 61 | 6c 20 66 69 6c 65 22 3b |r specia|l file";|
|00005c00| 0a 23 65 6e 64 69 66 0a | 23 69 66 64 65 66 20 53 |.#endif.|#ifdef S|
|00005c10| 5f 49 53 46 49 46 4f 0a | 20 20 69 66 20 28 53 5f |_ISFIFO.| if (S_|
|00005c20| 49 53 46 49 46 4f 20 28 | 73 74 2d 3e 73 74 5f 6d |ISFIFO (|st->st_m|
|00005c30| 6f 64 65 29 29 20 72 65 | 74 75 72 6e 20 22 66 69 |ode)) re|turn "fi|
|00005c40| 66 6f 22 3b 0a 23 65 6e | 64 69 66 0a 0a 20 20 2f |fo";.#en|dif.. /|
|00005c50| 2a 20 6f 74 68 65 72 20 | 50 6f 73 69 78 2e 31 62 |* other |Posix.1b|
|00005c60| 20 66 69 6c 65 20 74 79 | 70 65 73 20 2a 2f 0a 23 | file ty|pes */.#|
|00005c70| 69 66 64 65 66 20 53 5f | 54 59 50 45 49 53 4d 51 |ifdef S_|TYPEISMQ|
|00005c80| 0a 20 20 69 66 20 28 53 | 5f 54 59 50 45 49 53 4d |. if (S|_TYPEISM|
|00005c90| 51 20 28 73 74 29 29 20 | 72 65 74 75 72 6e 20 22 |Q (st)) |return "|
|00005ca0| 6d 65 73 73 61 67 65 20 | 71 75 65 75 65 22 3b 0a |message |queue";.|
|00005cb0| 23 65 6e 64 69 66 0a 23 | 69 66 64 65 66 20 53 5f |#endif.#|ifdef S_|
|00005cc0| 54 59 50 45 49 53 53 45 | 4d 0a 20 20 69 66 20 28 |TYPEISSE|M. if (|
|00005cd0| 53 5f 54 59 50 45 49 53 | 53 45 4d 20 28 73 74 29 |S_TYPEIS|SEM (st)|
|00005ce0| 29 20 72 65 74 75 72 6e | 20 22 73 65 6d 61 70 68 |) return| "semaph|
|00005cf0| 6f 72 65 22 3b 0a 23 65 | 6e 64 69 66 0a 23 69 66 |ore";.#e|ndif.#if|
|00005d00| 64 65 66 20 53 5f 54 59 | 50 45 49 53 53 48 4d 0a |def S_TY|PEISSHM.|
|00005d10| 20 20 69 66 20 28 53 5f | 54 59 50 45 49 53 53 48 | if (S_|TYPEISSH|
|00005d20| 4d 20 28 73 74 29 29 20 | 72 65 74 75 72 6e 20 22 |M (st)) |return "|
|00005d30| 73 68 61 72 65 64 20 6d | 65 6d 6f 72 79 20 6f 62 |shared m|emory ob|
|00005d40| 6a 65 63 74 22 3b 0a 23 | 65 6e 64 69 66 0a 0a 20 |ject";.#|endif.. |
|00005d50| 20 2f 2a 20 6f 74 68 65 | 72 20 70 6f 70 75 6c 61 | /* othe|r popula|
|00005d60| 72 20 66 69 6c 65 20 74 | 79 70 65 73 20 2a 2f 0a |r file t|ypes */.|
|00005d70| 20 20 2f 2a 20 53 5f 49 | 53 4c 4e 4b 20 69 73 20 | /* S_I|SLNK is |
|00005d80| 69 6d 70 6f 73 73 69 62 | 6c 65 20 77 69 74 68 20 |impossib|le with |
|00005d90| 60 66 73 74 61 74 27 20 | 61 6e 64 20 60 73 74 61 |`fstat' |and `sta|
|00005da0| 74 27 2e 20 20 2a 2f 0a | 23 69 66 64 65 66 20 53 |t'. */.|#ifdef S|
|00005db0| 5f 49 53 53 4f 43 4b 0a | 20 20 69 66 20 28 53 5f |_ISSOCK.| if (S_|
|00005dc0| 49 53 53 4f 43 4b 20 28 | 73 74 2d 3e 73 74 5f 6d |ISSOCK (|st->st_m|
|00005dd0| 6f 64 65 29 29 20 72 65 | 74 75 72 6e 20 22 73 6f |ode)) re|turn "so|
|00005de0| 63 6b 65 74 22 3b 0a 23 | 65 6e 64 69 66 0a 0a 20 |cket";.#|endif.. |
|00005df0| 20 72 65 74 75 72 6e 20 | 22 77 65 69 72 64 20 66 | return |"weird f|
|00005e00| 69 6c 65 22 3b 0a 7d 0a | 0c 0a 2f 2a 20 43 6f 6d |ile";.}.|../* Com|
|00005e10| 70 61 72 65 20 74 77 6f | 20 66 69 6c 65 73 20 28 |pare two| files (|
|00005e20| 6f 72 20 64 69 72 73 29 | 20 77 69 74 68 20 73 70 |or dirs)| with sp|
|00005e30| 65 63 69 66 69 65 64 20 | 6e 61 6d 65 73 0a 20 20 |ecified |names. |
|00005e40| 20 44 49 52 30 2f 4e 41 | 4d 45 30 20 61 6e 64 20 | DIR0/NA|ME0 and |
|00005e50| 44 49 52 31 2f 4e 41 4d | 45 31 2c 20 61 74 20 6c |DIR1/NAM|E1, at l|
|00005e60| 65 76 65 6c 20 44 45 50 | 54 48 20 69 6e 20 64 69 |evel DEP|TH in di|
|00005e70| 72 65 63 74 6f 72 79 20 | 72 65 63 75 72 73 69 6f |rectory |recursio|
|00005e80| 6e 2e 0a 20 20 20 28 69 | 66 20 44 49 52 30 20 69 |n.. (i|f DIR0 i|
|00005e90| 73 20 30 2c 20 74 68 65 | 6e 20 74 68 65 20 6e 61 |s 0, the|n the na|
|00005ea0| 6d 65 20 69 73 20 6a 75 | 73 74 20 4e 41 4d 45 30 |me is ju|st NAME0|
|00005eb0| 2c 20 65 74 63 2e 29 0a | 20 20 20 54 68 69 73 20 |, etc.).| This |
|00005ec0| 69 73 20 73 65 6c 66 2d | 63 6f 6e 74 61 69 6e 65 |is self-|containe|
|00005ed0| 64 3b 20 69 74 20 6f 70 | 65 6e 73 20 74 68 65 20 |d; it op|ens the |
|00005ee0| 66 69 6c 65 73 20 61 6e | 64 20 63 6c 6f 73 65 73 |files an|d closes|
|00005ef0| 20 74 68 65 6d 2e 0a 0a | 20 20 20 56 61 6c 75 65 | them...| Value|
|00005f00| 20 69 73 20 30 20 69 66 | 20 66 69 6c 65 73 20 61 | is 0 if| files a|
|00005f10| 72 65 20 74 68 65 20 73 | 61 6d 65 2c 20 31 20 69 |re the s|ame, 1 i|
|00005f20| 66 20 64 69 66 66 65 72 | 65 6e 74 2c 0a 20 20 20 |f differ|ent,. |
|00005f30| 32 20 69 66 20 74 68 65 | 72 65 20 69 73 20 61 20 |2 if the|re is a |
|00005f40| 70 72 6f 62 6c 65 6d 20 | 6f 70 65 6e 69 6e 67 20 |problem |opening |
|00005f50| 74 68 65 6d 2e 20 20 2a | 2f 0a 0a 73 74 61 74 69 |them. *|/..stati|
|00005f60| 63 20 69 6e 74 0a 63 6f | 6d 70 61 72 65 5f 66 69 |c int.co|mpare_fi|
|00005f70| 6c 65 73 20 28 64 69 72 | 30 2c 20 6e 61 6d 65 30 |les (dir|0, name0|
|00005f80| 2c 20 64 69 72 31 2c 20 | 6e 61 6d 65 31 2c 20 64 |, dir1, |name1, d|
|00005f90| 65 70 74 68 29 0a 20 20 | 20 20 20 63 68 61 72 20 |epth). | char |
|00005fa0| 63 6f 6e 73 74 20 2a 64 | 69 72 30 2c 20 2a 64 69 |const *d|ir0, *di|
|00005fb0| 72 31 3b 0a 20 20 20 20 | 20 63 68 61 72 20 63 6f |r1;. | char co|
|00005fc0| 6e 73 74 20 2a 6e 61 6d | 65 30 2c 20 2a 6e 61 6d |nst *nam|e0, *nam|
|00005fd0| 65 31 3b 0a 20 20 20 20 | 20 69 6e 74 20 64 65 70 |e1;. | int dep|
|00005fe0| 74 68 3b 0a 7b 0a 20 20 | 73 74 72 75 63 74 20 66 |th;.{. |struct f|
|00005ff0| 69 6c 65 5f 64 61 74 61 | 20 69 6e 66 5b 32 5d 3b |ile_data| inf[2];|
|00006000| 0a 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 |. regis|ter int |
|00006010| 69 3b 0a 20 20 69 6e 74 | 20 76 61 6c 3b 0a 20 20 |i;. int| val;. |
|00006020| 69 6e 74 20 73 61 6d 65 | 5f 66 69 6c 65 73 3b 0a |int same|_files;.|
|00006030| 20 20 69 6e 74 20 66 61 | 69 6c 65 64 20 3d 20 30 | int fa|iled = 0|
|00006040| 3b 0a 20 20 63 68 61 72 | 20 2a 66 72 65 65 30 20 |;. char| *free0 |
|00006050| 3d 20 30 2c 20 2a 66 72 | 65 65 31 20 3d 20 30 3b |= 0, *fr|ee1 = 0;|
|00006060| 0a 0a 20 20 2f 2a 20 49 | 66 20 74 68 69 73 20 69 |.. /* I|f this i|
|00006070| 73 20 64 69 72 65 63 74 | 6f 72 79 20 63 6f 6d 70 |s direct|ory comp|
|00006080| 61 72 69 73 6f 6e 2c 20 | 70 65 72 68 61 70 73 20 |arison, |perhaps |
|00006090| 77 65 20 68 61 76 65 20 | 61 20 66 69 6c 65 0a 20 |we have |a file. |
|000060a0| 20 20 20 20 74 68 61 74 | 20 65 78 69 73 74 73 20 | that| exists |
|000060b0| 6f 6e 6c 79 20 69 6e 20 | 6f 6e 65 20 6f 66 20 74 |only in |one of t|
|000060c0| 68 65 20 64 69 72 65 63 | 74 6f 72 69 65 73 2e 0a |he direc|tories..|
|000060d0| 20 20 20 20 20 49 66 20 | 73 6f 2c 20 6a 75 73 74 | If |so, just|
|000060e0| 20 70 72 69 6e 74 20 61 | 20 6d 65 73 73 61 67 65 | print a| message|
|000060f0| 20 74 6f 20 74 68 61 74 | 20 65 66 66 65 63 74 2e | to that| effect.|
|00006100| 20 20 2a 2f 0a 0a 20 20 | 69 66 20 28 21 20 28 28 | */.. |if (! ((|
|00006110| 6e 61 6d 65 30 20 21 3d | 20 30 20 26 26 20 6e 61 |name0 !=| 0 && na|
|00006120| 6d 65 31 20 21 3d 20 30 | 29 0a 09 20 7c 7c 20 28 |me1 != 0|).. || (|
|00006130| 75 6e 69 64 69 72 65 63 | 74 69 6f 6e 61 6c 5f 6e |unidirec|tional_n|
|00006140| 65 77 5f 66 69 6c 65 5f | 66 6c 61 67 20 26 26 20 |ew_file_|flag && |
|00006150| 6e 61 6d 65 31 20 21 3d | 20 30 29 0a 09 20 7c 7c |name1 !=| 0).. |||
|00006160| 20 65 6e 74 69 72 65 5f | 6e 65 77 5f 66 69 6c 65 | entire_|new_file|
|00006170| 5f 66 6c 61 67 29 29 0a | 20 20 20 20 7b 0a 20 20 |_flag)).| {. |
|00006180| 20 20 20 20 63 68 61 72 | 20 63 6f 6e 73 74 20 2a | char| const *|
|00006190| 6e 61 6d 65 20 3d 20 6e | 61 6d 65 30 20 3d 3d 20 |name = n|ame0 == |
|000061a0| 30 20 3f 20 6e 61 6d 65 | 31 20 3a 20 6e 61 6d 65 |0 ? name|1 : name|
|000061b0| 30 3b 0a 20 20 20 20 20 | 20 63 68 61 72 20 63 6f |0;. | char co|
|000061c0| 6e 73 74 20 2a 64 69 72 | 20 3d 20 6e 61 6d 65 30 |nst *dir| = name0|
|000061d0| 20 3d 3d 20 30 20 3f 20 | 64 69 72 31 20 3a 20 64 | == 0 ? |dir1 : d|
|000061e0| 69 72 30 3b 0a 20 20 20 | 20 20 20 6d 65 73 73 61 |ir0;. | messa|
|000061f0| 67 65 20 28 22 4f 6e 6c | 79 20 69 6e 20 25 73 3a |ge ("Onl|y in %s:|
|00006200| 20 25 73 5c 6e 22 2c 20 | 64 69 72 2c 20 6e 61 6d | %s\n", |dir, nam|
|00006210| 65 29 3b 0a 20 20 20 20 | 20 20 2f 2a 20 52 65 74 |e);. | /* Ret|
|00006220| 75 72 6e 20 31 20 73 6f | 20 74 68 61 74 20 64 69 |urn 1 so| that di|
|00006230| 66 66 5f 64 69 72 73 20 | 77 69 6c 6c 20 72 65 74 |ff_dirs |will ret|
|00006240| 75 72 6e 20 31 20 28 22 | 73 6f 6d 65 20 66 69 6c |urn 1 ("|some fil|
|00006250| 65 73 20 64 69 66 66 65 | 72 22 29 2e 20 20 2a 2f |es diffe|r"). */|
|00006260| 0a 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 31 3b |. r|eturn 1;|
|00006270| 0a 20 20 20 20 7d 0a 0a | 20 20 62 7a 65 72 6f 20 |. }..| bzero |
|00006280| 28 69 6e 66 2c 20 73 69 | 7a 65 6f 66 20 28 69 6e |(inf, si|zeof (in|
|00006290| 66 29 29 3b 0a 0a 20 20 | 2f 2a 20 4d 61 72 6b 20 |f));.. |/* Mark |
|000062a0| 61 6e 79 20 6e 6f 6e 65 | 78 69 73 74 65 6e 74 20 |any none|xistent |
|000062b0| 66 69 6c 65 20 77 69 74 | 68 20 2d 31 20 69 6e 20 |file wit|h -1 in |
|000062c0| 74 68 65 20 64 65 73 63 | 20 66 69 65 6c 64 2e 20 |the desc| field. |
|000062d0| 20 2a 2f 0a 20 20 2f 2a | 20 4d 61 72 6b 20 75 6e | */. /*| Mark un|
|000062e0| 6f 70 65 6e 65 64 20 66 | 69 6c 65 73 20 28 65 2e |opened f|iles (e.|
|000062f0| 67 2e 20 64 69 72 65 63 | 74 6f 72 69 65 73 29 20 |g. direc|tories) |
|00006300| 77 69 74 68 20 2d 32 2e | 20 2a 2f 0a 0a 20 20 69 |with -2.| */.. i|
|00006310| 6e 66 5b 30 5d 2e 64 65 | 73 63 20 3d 20 6e 61 6d |nf[0].de|sc = nam|
|00006320| 65 30 20 3d 3d 20 30 20 | 3f 20 2d 31 20 3a 20 2d |e0 == 0 |? -1 : -|
|00006330| 32 3b 0a 20 20 69 6e 66 | 5b 31 5d 2e 64 65 73 63 |2;. inf|[1].desc|
|00006340| 20 3d 20 6e 61 6d 65 31 | 20 3d 3d 20 30 20 3f 20 | = name1| == 0 ? |
|00006350| 2d 31 20 3a 20 2d 32 3b | 0a 0a 20 20 2f 2a 20 4e |-1 : -2;|.. /* N|
|00006360| 6f 77 20 72 65 63 6f 72 | 64 20 74 68 65 20 66 75 |ow recor|d the fu|
|00006370| 6c 6c 20 6e 61 6d 65 20 | 6f 66 20 65 61 63 68 20 |ll name |of each |
|00006380| 66 69 6c 65 2c 20 69 6e | 63 6c 75 64 69 6e 67 20 |file, in|cluding |
|00006390| 6e 6f 6e 65 78 69 73 74 | 65 6e 74 20 6f 6e 65 73 |nonexist|ent ones|
|000063a0| 2e 20 20 2a 2f 0a 0a 20 | 20 69 66 20 28 6e 61 6d |. */.. | if (nam|
|000063b0| 65 30 20 3d 3d 20 30 29 | 0a 20 20 20 20 6e 61 6d |e0 == 0)|. nam|
|000063c0| 65 30 20 3d 20 6e 61 6d | 65 31 3b 0a 20 20 69 66 |e0 = nam|e1;. if|
|000063d0| 20 28 6e 61 6d 65 31 20 | 3d 3d 20 30 29 0a 20 20 | (name1 |== 0). |
|000063e0| 20 20 6e 61 6d 65 31 20 | 3d 20 6e 61 6d 65 30 3b | name1 |= name0;|
|000063f0| 0a 0a 20 20 69 6e 66 5b | 30 5d 2e 6e 61 6d 65 20 |.. inf[|0].name |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.